public override void UnInitializeControl() { if (_expertControl != null) { _expertControl.UnInitializeControl(); } if (_expertHost != null) { //_host.SessionsUpdateEvent -= new GeneralHelper.GenericDelegate<ISourceManager>(_expertHost_SessionsUpdateEvent); //_host.SourcesUpdateEvent -= new GeneralHelper.GenericDelegate<ISourceManager>(_expertHost_SourcesUpdateEvent); _expertHost.OperationalStateChangedEvent -= new OperationalStateChangedDelegate(expertHost_OperationalStatusChangedEvent); _expertHost = null; } base.UnInitializeControl(); }
/// <summary> /// /// </summary> /// <param name="expertHost"></param> void Initialize(ExpertHost expertHost) { this.Name = expertHost.Name; _expertHost = expertHost; _expertHost.OperationalStateChangedEvent += new OperationalStateChangedDelegate(expertHost_OperationalStatusChangedEvent); // Create early here, to be able to use the image name. _expertControl = CommonBaseControl.CreateCorrespondingControl(_expertHost.Expert, true); this.ImageName = _expertControl.ImageName; //_host.SessionsUpdateEvent += new GeneralHelper.GenericDelegate<ISourceManager>(_expertHost_SessionsUpdateEvent); //_host.SourcesUpdateEvent += new GeneralHelper.GenericDelegate<ISourceManager>(_expertHost_SourcesUpdateEvent); //DoUpdateUI(); }
protected override void OnHandleDestroyed(EventArgs e) { base.OnHandleDestroyed(e); if (_host != null) { _host = null; } }
/// <summary> /// /// </summary> public ComponentTradingExpert(ISourceAndExpertSessionManager sessionManager, string name) : base(sessionManager, name) { _host = (ExpertHost)sessionManager; }