/// <summary> /// 初始化代理 /// </summary> public void CreatProxy() { try { ChannelFactory = new ChannelFactory<IJszxService>("JszxService"); Proxy = ChannelFactory.CreateChannel(); } catch(Exception ex){ MessageBox.Show(ex.Message); } }
/// <summary> /// 初始化LabCombobox /// </summary> private void InitializeLabCombobox() { Proxy = ChannelFactory.CreateChannel(); labID = Properties.Settings.Default.LabID; labName = Properties.Settings.Default.LabName; labList = Proxy.GetLabList(); this.LabComboBox.ItemsSource = labList; //设置选中项 this.LabComboBox.SelectedValue = labID; //在初始化完成后再添加事件 this.LabComboBox.SelectionChanged += new SelectionChangedEventHandler(LabComboBox_SelectionChanged_1); }