/// <summary> /// Handles the form closing event. This stops and destroys all additional /// subsystems prior to form destruction. /// </summary> /// <param name="sender"> /// The object sending the event call. /// </param> /// <param name="e"> /// The event arguments. /// </param> private void FormExternalToolBase_FormClosing(object sender, FormClosingEventArgs e) { if (this._sr != null) { this._sr.Dispose(); this._sr = null; } if (this._printDoc != null) { this._printDoc.Dispose(); this._printDoc = null; } this.UnregisterPingEvents(); if (this._pm != null) { if (this._pm.IsRunning) { this._pm.Cancel(); } this._pm.Dispose(); this._pm = null; } }
/// <summary> /// Initializes a new instance of the <see cref="CyrusBuilt.CyNetTools.FormPing"/> /// class. This is the default constructor. /// </summary> /// <param name="mdiParent"> /// The form that is the MDI parent of this form. /// </param> public FormPing(Form mdiParent) { this.InitializeComponent(); this.MdiParent = mdiParent; this._printDoc = new PrintDocument(); this._pm = new PingModule(); }