protected override void OnClosed(EventArgs e) { if (this.expertHost != null) { this.expertHost.UnInitialize(); this.expertHost = null; } if (this.client != null) { this.SessionCheckBox.Enabled = false; if (this.platform != null) { this.platform.UnRegisterSource(SourceTypeEnum.HighPriorityLiveFullProvider, this.client.ProxyTransportInfo); } this.client.Stop(out this.message); this.client = null; } if (this.platform != null) { this.platform = null; } base.OnClosed(e); }
protected virtual void ConnectCheckBox_CheckedChanged(object sender, EventArgs e) { if (this.ConnectCheckBox.Checked) { if (this.client == null) { this.client = new ProxyIntegrationAdapterClient(new Uri(this.PlatformUri)); if (this.client.Start(this.platform, out this.message)) { this.UpdateStatus(); this.client.OperationalStateChangedEvent += new OperationalStateChangedDelegate(client_OperationalStateChangedEvent); } } } else { if (this.client != null && this.clientID != ComponentId.Empty) { this.SessionCheckBox.Enabled = false; this.SessionCheckBox.Checked = false; this.URLTextBox.Enabled = true; this.ExpertNameTextBox.Enabled = true; this.clientID = ComponentId.Empty; if (this.platform != null) { this.platform.UnRegisterSource(SourceTypeEnum.HighPriorityLiveFullProvider, this.client.ProxyTransportInfo); } this.client.Stop(out this.message); this.UpdateStatus(); this.client = null; } } }