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


C# InstanceContext.Open方法代碼示例

本文整理匯總了C#中System.ServiceModel.InstanceContext.Open方法的典型用法代碼示例。如果您正苦於以下問題:C# InstanceContext.Open方法的具體用法?C# InstanceContext.Open怎麽用?C# InstanceContext.Open使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.ServiceModel.InstanceContext的用法示例。


在下文中一共展示了InstanceContext.Open方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Form1

        public Form1()
        {
            ServerCallback = new AnhCallback();
            InitializeComponent();
            ServerCallback.MessageReceived += new EventHandler<MessageEventArgs>(ServerCallback_MessageReceived);
            ServerCallback.AvailableServerListReceived += new EventHandler<AvailableServerEventArgs>(ServerCallback_AvailableServerListReceived);
            ServerCallback.StatusReceived += new EventHandler<ServerStatusEventArgs>(ServerCallback_StatusReceived);

            ic = new InstanceContext(ServerCallback);
            client = new AnhServiceClient(ic);
            ic.Faulted += new EventHandler(ic_Faulted);
            ic.Open();

            Servers s = new Servers(ServerType.ConnectionServer, "");
            comboBox1.Items.Add(s);
            s = new Servers(ServerType.ChatServer, "");
            comboBox1.Items.Add(s);
            s = new Servers(ServerType.LoginServer, "");
            comboBox1.Items.Add(s);
            s = new Servers(ServerType.PingServer, "");
            comboBox1.Items.Add(s);
            s = new Servers(ServerType.ZoneServer, "tutorial");
            comboBox1.Items.Add(s);
            s = new Servers(ServerType.ZoneServer, "tatooine");
            comboBox1.Items.Add(s);
            comboBox1.SelectedIndex = 0;
        }
開發者ID:swganhtools,項目名稱:anhtoolsservice,代碼行數:27,代碼來源:Form1.cs

示例2: ic_Faulted

 void ic_Faulted(object sender, EventArgs e)
 {
     ic.Abort();
     ic = new InstanceContext(ServerCallback);
     ic.Open();
     listBox1.Items.Add("Channel Fault repaired");
 }
開發者ID:swganhtools,項目名稱:anhtoolslibs,代碼行數:7,代碼來源:frmClient.cs

示例3: EnsureInstanceContextOpen

		void EnsureInstanceContextOpen (InstanceContext ictx)
		{
			if (ictx.State != CommunicationState.Opened)
				ictx.Open ();
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:5,代碼來源:PostReceiveRequestHandler.cs


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