當前位置: 首頁>>代碼示例>>C#>>正文


C# Discovery.EndpointDiscoveryMetadata類代碼示例

本文整理匯總了C#中System.ServiceModel.Discovery.EndpointDiscoveryMetadata的典型用法代碼示例。如果您正苦於以下問題:C# EndpointDiscoveryMetadata類的具體用法?C# EndpointDiscoveryMetadata怎麽用?C# EndpointDiscoveryMetadata使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EndpointDiscoveryMetadata類屬於System.ServiceModel.Discovery命名空間,在下文中一共展示了EndpointDiscoveryMetadata類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的System.ServiceModel.Discovery.EndpointDiscoveryMetadata類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。