/// <summary> /// Executes in two distinct scenarios. /// /// 1. If disposing is true, the method has been called directly /// or indirectly by a user's code via the Dispose method. /// Both managed and unmanaged resources can be disposed. /// /// 2. If disposing is false, the method has been called by the /// runtime from inside the finalizer and you should not reference (access) /// other managed objects, as they already have been garbage collected. /// Only unmanaged resources can be disposed. /// </summary> /// <param name="disposing"></param> /// <remarks> /// If any exceptions are thrown, that is fine. /// If the method is being done in a finalizer, it will be ignored. /// If it is thrown by client code calling Dispose, /// it needs to be handled by fixing the bug. /// /// If subclasses override this method, they should call the base implementation. /// </remarks> protected virtual void Dispose(bool disposing) { System.Diagnostics.Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** "); // Must not be run more than once. if (m_isDisposed) { return; } if (disposing) { // Dispose managed resources here. if (m_mediator != null) { m_mediator.RemoveColleague(this); } if (m_cache != null && !m_cache.IsDisposed && m_cache.DomainDataByFlid != null) { m_cache.DomainDataByFlid.RemoveNotification(this); } } // Dispose unmanaged resources here, whether disposing is true or false. m_mediator = null; m_configurationParameters = null; m_isDisposed = true; }
/// ----------------------------------------------------------------------------------- /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged /// resources; <c>false</c> to release only unmanaged resources. /// </param> /// ----------------------------------------------------------------------------------- protected override void Dispose(bool disposing) { //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************"); // Must not be run more than once. if (IsDisposed) { return; } if (disposing) { if (components != null) { components.Dispose(); } if (ExistingClerk != null) { ExistingClerk.BecomeInactive(); } if (m_mediator != null) { m_mediator.RemoveColleague(this); } if (m_mpParent != null) { m_mpParent.ShowFirstPaneChanged -= new EventHandler(mp_ShowFirstPaneChanged); m_mpParent.ShowFirstPaneChanged -= new EventHandler(mp_ShowFirstPaneChanged); } } m_mediator = null; m_informationBar = null; // Should be disposed automatically, since it is in the Controls collection. m_mpParent = null; base.Dispose(disposing); }
/// <summary> /// Executes in two distinct scenarios. /// /// 1. If disposing is true, the method has been called directly /// or indirectly by a user's code via the Dispose method. /// Both managed and unmanaged resources can be disposed. /// /// 2. If disposing is false, the method has been called by the /// runtime from inside the finalizer and you should not reference (access) /// other managed objects, as they already have been garbage collected. /// Only unmanaged resources can be disposed. /// </summary> /// <param name="disposing"></param> /// <remarks> /// If any exceptions are thrown, that is fine. /// If the method is being done in a finalizer, it will be ignored. /// If it is thrown by client code calling Dispose, /// it needs to be handled by fixing the bug. /// /// If subclasses override this method, they should call the base implementation. /// </remarks> protected virtual void Dispose(bool disposing) { //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************"); // Must not be run more than once. if (m_isDisposed) { return; } if (disposing) { // Dispose managed resources here. if (m_mediator != null) { // Not sure why this is retrieved from the mediator and not used, // so commenting out for now. // FdoCache cache = (FdoCache)m_mediator.PropertyTable.GetValue("cache"); m_mediator.RemoveColleague(this); } } // Dispose unmanaged resources here, whether disposing is true or false. m_mediator = null; m_configurationParameters = null; m_isDisposed = true; }
/// <summary> /// Executes in two distinct scenarios. /// /// 1. If disposing is true, the method has been called directly /// or indirectly by a user's code via the Dispose method. /// Both managed and unmanaged resources can be disposed. /// /// 2. If disposing is false, the method has been called by the /// runtime from inside the finalizer and you should not reference (access) /// other managed objects, as they already have been garbage collected. /// Only unmanaged resources can be disposed. /// </summary> /// <param name="disposing"></param> /// <remarks> /// If any exceptions are thrown, that is fine. /// If the method is being done in a finalizer, it will be ignored. /// If it is thrown by client code calling Dispose, /// it needs to be handled by fixing the bug. /// /// If subclasses override this method, they should call the base implementation. /// </remarks> protected virtual void Dispose(bool disposing) { //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************"); // Must not be run more than once. if (m_isDisposed) { return; } // m_sda COM object block removed due to crash in Finializer thread LT-6124 if (disposing) { // Dispose managed resources here. if (m_updateTimer != null) { m_updateTimer.Stop(); m_updateTimer.Tick -= new EventHandler(m_updateTimer_Elapsed); m_updateTimer.Dispose(); } if (m_sda != null) { m_sda.RemoveNotification(this); } m_mediator.RemoveColleague(this); ParserConnection cnx = Connection; if (cnx != null) { // Remove ParserConnection from the PropertyTable. m_mediator.PropertyTable.SetProperty("ParserConnection", null, false); m_mediator.PropertyTable.SetPropertyPersistence("ParserConnection", false); m_mediator.PropertyTable.SetProperty("ParserListener", null, false); m_mediator.PropertyTable.SetPropertyPersistence("ParserListener", false); cnx.Dispose(); } } // Dispose unmanaged resources here, whether disposing is true or false. m_sda = null; m_mediator = null; m_cache = null; m_updateTimer = null; m_traceSwitch = null; m_isDisposed = true; }
/// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose(bool disposing) { //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************"); // Must not be run more than once. if (IsDisposed) { return; } if (disposing) { if (components != null) { components.Dispose(); } if (m_mediator != null) { m_mediator.RemoveColleague(this); } if (m_fxtDumper != null) { m_fxtDumper.Dispose(); } if (m_stringResMan != null) { m_stringResMan.ReleaseAllResources(); } } m_mediator = null; m_fxtDumper = null; m_fxtNode = null; m_transformsNode = null; m_sHtmlFileName = null; m_configurationParameters = null; m_sProgressDialogTitle = null; m_sRegKeyName = null; m_sFileNameKey = null; m_stringResMan = null; m_AlsoSaveTransformNode = null; m_sAlsoSaveDialogTitle = null; m_sAlsoSaveFileName = null; m_sReplaceDoctype = null; m_sSaveAsWebpageDialogTitle = null; base.Dispose(disposing); }
/// <summary> /// Executes in two distinct scenarios. /// /// 1. If disposing is true, the method has been called directly /// or indirectly by a user's code via the Dispose method. /// Both managed and unmanaged resources can be disposed. /// /// 2. If disposing is false, the method has been called by the /// runtime from inside the finalizer and you should not reference (access) /// other managed objects, as they already have been garbage collected. /// Only unmanaged resources can be disposed. /// </summary> /// <param name="disposing"></param> /// <remarks> /// If any exceptions are thrown, that is fine. /// If the method is being done in a finalizer, it will be ignored. /// If it is thrown by client code calling Dispose, /// it needs to be handled by fixing the bug. /// /// If subclasses override this method, they should call the base implementation. /// </remarks> protected virtual void Dispose(bool disposing) { //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************"); // Must not be run more than once. if (m_isDisposed) { return; } if (disposing) { // Dispose managed resources here. if (m_mediator != null) { m_mediator.RemoveColleague(this); } } // Dispose unmanaged resources here, whether disposing is true or false. m_isDisposed = true; }
protected override void LoadListInternal(Mediator mediator, SplitterPanel parent) { // Add the new browse view, if available in the config node. if (m_configurationNode.HasChildNodes) { RecordBrowseView browseView = new RecordBrowseView(); browseView.SuspendLayout(); browseView.Dock = DockStyle.Fill; m_currentControl = browseView; parent.Controls.Add(browseView); browseView.Init(mediator, m_configurationNode.SelectSingleNode("parameters")); mediator.RemoveColleague(browseView); browseView.BringToFront(); browseView.ResumeLayout(); m_mediator.AddColleague(this); } base.LoadListInternal(mediator, parent); }