コード例 #1
0
        /// <summary>
        /// Event handler for the F4 function key. Hides this form and displays the form which allows the user to step through individual data frames.
        /// </summary>
        /// <param name="sender">Reference to the object that raised the event.</param>
        /// <param name="e">Parameter passed from the object that raised the event.</param>
        protected override void F4_Click(object sender, EventArgs e)
        {
            // Skip, if the Dispose() method has been called.
            if (IsDisposed)
            {
                return;
            }

            // Skip if the key isn't enabled.
            if (F4.Enabled == false)
            {
                return;
            }

            Cursor = Cursors.WaitCursor;
            F4.Checked = true;

            // Clear the status message.
            MainWindow.WriteStatusMessage(string.Empty);

            CloseShowFlags();

            try
            {
                m_FormDataStreamReplay = new FormDataStreamReplay(m_HistoricDataManager, WatchFile);
                m_FormDataStreamReplay.MdiParent = MdiParent;

                // The CalledFrom property is used to allow the called form to reference back to this form.
                m_FormDataStreamReplay.CalledFrom = this;
                m_FormDataStreamReplay.Show();
                Hide();
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, Resources.MBCaptionInformation, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            F4.Checked = false;
            Cursor = Cursors.Default;
        }
コード例 #2
0
        /// <summary>
        /// Clean up the resources used by the form.
        /// </summary>
        /// <param name="disposing">True to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
        protected override void Cleanup(bool disposing)
        {
            try
            {

                // Method called by consumer code. Call the Dispose method of any managed data members that implement the dispose method.
                // Cleanup managed objects by calling their Dispose() methods.
                if (disposing)
                {
                    if (components != null)
                    {
                        components.Dispose();
                    }
                }
				
				// Whether called by consumer code or the garbage collector free all unmanaged resources and set the value of managed data 
                // members to null.
                m_PlotterControlLayout = null;
                m_HistoricDataManager = null;
                m_FormDataStreamReplay = null;

                #region - [Detach the event handler methods.] -
                this.Shown -= new EventHandler(this.FormDataStreamPlot_Shown);
                #endregion - [Detach the event handler methods.] -

                #region - [Component Designer Variables] -
                this.m_PanelSupplementalInformation = null;
                this.m_LabelSupplementalInformation = null;
                this.m_LegendSupplementalInformation = null;
                #endregion - [Component Designer Variables] -
            }
            catch (Exception)
            {
                // Don't do anything, just ensure that an exception isn't thrown.
            }
            finally
            {
                base.Cleanup(disposing);
            }
        }