本文整理汇总了C#中System.ServiceModel.Discovery.EndpointDiscoveryMetadata类的典型用法代码示例。如果您正苦于以下问题:C# EndpointDiscoveryMetadata类的具体用法?C# EndpointDiscoveryMetadata怎么用?C# EndpointDiscoveryMetadata使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EndpointDiscoveryMetadata类属于System.ServiceModel.Discovery命名空间,在下文中一共展示了EndpointDiscoveryMetadata类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RemoveService
private void RemoveService(ServiceHost serviceHost, EndpointDiscoveryMetadata endpoint)
{
if (IsSelfDiscovery(serviceHost, endpoint) == false)
{
serviceCatalog.RemoveService(endpoint);
}
}
开发者ID:ramonsmits,项目名称:Castle.Facilities.Wcf,代码行数:7,代码来源:AdHocServiceCatalogDiscovery.cs
示例2: RemoveEndpointMetadata
public override void RemoveEndpointMetadata(EndpointDiscoveryMetadata metadata)
{
var uri = metadata.Address.Uri.AbsoluteUri;
var addressJson = JsonConvert.SerializeObject(metadata.Address);
var contractTypeNames = metadata.GetContractTypeNames();
var bindingTypeName = metadata.GetBindingTypeName();
using (var conn = _connectionCreator.Invoke(_connectionString))
{
var cmd = conn.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "UnRegisterServiceEndpointMetadata";
cmd.AddParameter("uri", uri)
.AddParameter("contractType", null)
.AddParameter("address", addressJson)
.AddParameter("bindingType", bindingTypeName);
conn.Open();
cmd.Transaction = conn.BeginTransaction();
foreach (var contractTypeName in contractTypeNames)
{
cmd.GetParameter("contractType").Value = contractTypeName;
cmd.ExecuteNonQuery();
}
cmd.Transaction.Commit();
}
}
开发者ID:shaunxu,项目名称:phare,代码行数:26,代码来源:DbEndpointMetadataProvider.cs
示例3: AnnouncementEventArgs
internal AnnouncementEventArgs(
DiscoveryMessageSequence messageSequence,
EndpointDiscoveryMetadata endpointDiscoveryMetadata)
{
this.MessageSequence = messageSequence;
this.EndpointDiscoveryMetadata = endpointDiscoveryMetadata;
}
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:AnnouncementEventArgs.cs
示例4: FindProgressChangedEventArgs
internal FindProgressChangedEventArgs(int progressPercentage, object userState,
EndpointDiscoveryMetadata endpointDiscoveryMetadata, DiscoveryMessageSequence messageSequence)
: base(progressPercentage, userState)
{
this.endpointDiscoveryMetadata = endpointDiscoveryMetadata;
this.messageSequence = messageSequence;
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:FindProgressChangedEventArgs.cs
示例5: AnnonceOnlineOfflineNoBinding
public void AnnonceOnlineOfflineNoBinding ()
{
var ac = new AnnouncementClient (new AnnouncementEndpoint () { Address = new EndpointAddress ("http://localhost:37564")});
var edm = new EndpointDiscoveryMetadata ();
ac.AnnounceOnline (edm);
// attempt to close the client causes another CommunicationObjectFaultedException - looks like it fails to allow Close() at faulted state unlike other objects.
}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:AnnouncementClientTest.cs
示例6: RegisterEndpoint
public virtual bool RegisterEndpoint(EndpointDiscoveryMetadata endpoint)
{
var registered = false;
if (AcceptEndpoint(endpoint))
{
using (var locker = @lock.ForReadingUpgradeable())
{
policies.ForEach(policy => registered = registered | policy.RegisterTarget(endpoint));
locker.Upgrade();
if (registered == false)
{
var newPolicies = policyFactory.CreatePolicies(endpoint);
Array.ForEach(newPolicies, newPolicy =>
{
registered = registered | newPolicy.RegisterTarget(endpoint);
policies.Add(newPolicy);
});
}
if (registered)
endpoints[endpoint.Address] = endpoint;
}
}
return registered;
}
开发者ID:castleproject,项目名称:Windsor,代码行数:27,代码来源:InMemoryServiceCatalog.cs
示例7: OnBeginOfflineAnnouncement
protected override IAsyncResult OnBeginOfflineAnnouncement(
DiscoveryMessageSequence messageSequence, EndpointDiscoveryMetadata endpointDiscoveryMetadata,
AsyncCallback callback, object state)
{
implementation.RemoveEndpoint(endpointDiscoveryMetadata);
return new SynchronousResult(callback, state);
}
开发者ID:RookieX,项目名称:Windsor,代码行数:7,代码来源:ServiceCatalog.cs
示例8: RegisterService
private void RegisterService(ServiceHost serviceHost, EndpointDiscoveryMetadata endpoint)
{
if (FilterService(serviceHost, endpoint) == false)
{
serviceCatalog.RegisterService(endpoint);
}
}
开发者ID:castleproject,项目名称:Windsor,代码行数:7,代码来源:AdHocServiceCatalogDiscovery.cs
示例9: OnBeginOfflineAnnouncement
protected override IAsyncResult OnBeginOfflineAnnouncement(DiscoveryMessageSequence messageSequence, EndpointDiscoveryMetadata endpointDiscoveryMetadata, AsyncCallback callback, object state)
{
try
{
if (endpointDiscoveryMetadata == null)
{
throw new ArgumentNullException("endpointDiscoveryMetadata");
}
// We care only about ISimpleChatService services
FindCriteria criteria = new FindCriteria(typeof(ISimpleChatService));
if (criteria.IsMatch(endpointDiscoveryMetadata))
{
endpointDiscoveryMetadata.WriteLine("Removing");
Cache.Remove(endpointDiscoveryMetadata.Address.Uri);
}
}
catch (KeyNotFoundException)
{
// No problem if it does not exist in the cache
}
return new CompletedAsyncResult(callback, state);
}
开发者ID:Helen1987,项目名称:edu,代码行数:25,代码来源:ChatDiscoveryProxy.cs
示例10: PopulateUserList
private void PopulateUserList(EndpointDiscoveryMetadata endpointDiscoveryMetadata)
{
if (!this.EndpointIsSelf(endpointDiscoveryMetadata.Address.Uri))
{
this.AddUser(new PeerUser(endpointDiscoveryMetadata.Address));
}
}
开发者ID:Helen1987,项目名称:edu,代码行数:7,代码来源:SimpleChat.cs
示例11: OnBeginOfflineAnnouncement
//OfflineAnnouncement
protected override IAsyncResult OnBeginOfflineAnnouncement(DiscoveryMessageSequence messageSequence, EndpointDiscoveryMetadata endpointDiscoveryMetadata, AsyncCallback callback, object state)
{
if (this.Endpoints.ContainsKey(endpointDiscoveryMetadata.Address))
{
this.Endpoints.Remove(endpointDiscoveryMetadata.Address);
}
return new DiscoveryAsyncResult(callback, state);
}
开发者ID:huoxudong125,项目名称:WCF-Demo,代码行数:9,代码来源:DiscoveryProxyService.cs
示例12: AddOnlineService
// The following are helper methods required by the Proxy implementation
void AddOnlineService(EndpointDiscoveryMetadata endpointDiscoveryMetadata)
{
lock (this.onlineServices)
{
this.onlineServices[endpointDiscoveryMetadata.Address] = endpointDiscoveryMetadata;
}
}
开发者ID:jonteho,项目名称:ticketing-office,代码行数:9,代码来源:DiscoveryProxy.svc.cs
示例13: RegisterService
public virtual void RegisterService(EndpointDiscoveryMetadata endpointDiscoveryMetadata)
{
if (AcceptService(endpointDiscoveryMetadata))
{
services.AddOrUpdate(endpointDiscoveryMetadata.Address, endpointDiscoveryMetadata,
(address, existing) => endpointDiscoveryMetadata);
}
}
开发者ID:ramonsmits,项目名称:Castle.Facilities.Wcf,代码行数:8,代码来源:InMemoryServiceCatalog.cs
示例14: RegisterEndpoint
public virtual void RegisterEndpoint(EndpointDiscoveryMetadata endpointDiscoveryMetadata)
{
if (AcceptEndpoint(endpointDiscoveryMetadata))
{
endpoints.AddOrUpdate(endpointDiscoveryMetadata.Address, endpointDiscoveryMetadata,
(address, existing) => endpointDiscoveryMetadata);
}
}
开发者ID:rtr0mdrn,项目名称:Windsor,代码行数:8,代码来源:InMemoryServiceCatalog.cs
示例15: OnBeginOnlineAnnouncement
// OnBeginOnlineAnnouncement method is called when a Hello message is received by the Proxy
protected override IAsyncResult OnBeginOnlineAnnouncement(DiscoveryMessageSequence messageSequence,
EndpointDiscoveryMetadata endpointDiscoveryMetadata,
AsyncCallback callback, object state)
{
_logger.Log("OnBeginOnlineAnnouncement()", LogLevel.Debug);
_provider.Add(endpointDiscoveryMetadata);
return new OnOnlineAnnouncementAsyncResult(callback, state);
}
开发者ID:larsw,项目名称:DiscoveryProxy,代码行数:9,代码来源:DiscoveryProxyService.cs
示例16: AddMatchingEndpoint
public void AddMatchingEndpoint(EndpointDiscoveryMetadata matchingEndpoint)
{
if (matchingEndpoint == null)
{
throw FxTrace.Exception.ArgumentNull("matchingEndpoint");
}
this.OnAddMatchingEndpoint(matchingEndpoint);
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:FindRequestContext.cs
示例17: MatchedEndpointDiscoveryMetadata
public MatchedEndpointDiscoveryMetadata(string addressJson, string bindingTypeName, string bindingJson, DateTime updatedOn)
{
_metadata = null;
_addressJson = addressJson;
_bindingTypeName = bindingTypeName;
_bindingJson = bindingJson;
_updatedOn = updatedOn;
}
开发者ID:shaunxu,项目名称:phare,代码行数:9,代码来源:MatchedEndpointDiscoveryMetadata.cs
示例18: Remove
public void Remove(EndpointDiscoveryMetadata endpointDiscoveryMetadata)
{
if (endpointDiscoveryMetadata != null)
{
OnlineService tmp;
_onlineServices.TryRemove(endpointDiscoveryMetadata.Address, out tmp);
_logger.Log("Removing " + endpointDiscoveryMetadata.Address, LogLevel.Debug);
}
}
开发者ID:larsw,项目名称:DiscoveryProxy,代码行数:9,代码来源:InMemoryOnlineServicesRepository.cs
示例19: AddOnlineService
// The following are helper methods required by the Proxy implementation
public void AddOnlineService(EndpointDiscoveryMetadata endpointDiscoveryMetadata)
{
lock (_onlineServices)
{
_onlineServices[endpointDiscoveryMetadata.Address] = endpointDiscoveryMetadata;
}
// Replace with log4net
//PrintDiscoveryMetadata(endpointDiscoveryMetadata, "Adding");
}
开发者ID:larsw,项目名称:DiscoveryProxy,代码行数:10,代码来源:InMemoryOnlineServicesProvider.cs
示例20: FromServiceEndpoint
public static EndpointDiscoveryMetadata FromServiceEndpoint (ServiceEndpoint endpoint)
{
var ret = new EndpointDiscoveryMetadata ();
ret.ContractTypeNames.Add (new XmlQualifiedName (endpoint.Contract.Name, endpoint.Contract.Namespace));
ret.Address = endpoint.Address;
if (endpoint.Address != null)
ret.ListenUris.Add (endpoint.Address.Uri);
return ret;
}
开发者ID:afaerber,项目名称:mono,代码行数:10,代码来源:EndpointDiscoveryMetadata.cs
注:本文中的System.ServiceModel.Discovery.EndpointDiscoveryMetadata类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论