Example #1
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
            {
                if (disposing)
                {
                    // 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 (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.
                DisposeOfUserControls();

                m_WatchControlLayout = null;
                m_WatchControls = null;
               
                #region - [Detach the event handler methods.] -
                #endregion - [Detach the event handler methods.] -
            }
            catch (Exception)
            {
                // Don't do anything, just ensure that an exception isn't thrown.
            }

            base.Cleanup(disposing);
        }
Example #2
0
        /// <summary>
        /// Form to view the watch variables in real time.
        /// </summary>
        public FormWatch(Workset_t workset) 
        {
            InitializeComponent();

            m_Workset = workset;

            #region - [WatchControlSize Definitions] -
            m_WatchControlSize = new VariableControlSize_t();
            m_WatchControlSize.Margin.Left = WatchControlLayout.MarginLeftWatchControl;
            m_WatchControlSize.Margin.Right = WatchControlLayout.MarginRightWatchControl;
            m_WatchControlSize.Margin.Top = WatchControlLayout.MarginTopWatchControl;
            m_WatchControlSize.Margin.Bottom = WatchControlLayout.MarginBottomWatchControl;
            m_WatchControlSize.WidthVariableNameField = WatchControlLayout.WidthWatchControlVariableNameField;
            m_WatchControlSize.WidthValueField = WatchControlLayout.WidthWatchControlValueField;
            m_WatchControlSize.WidthUnitsField = WatchControlLayout.WidthWatchControlUnitsField;
            m_WatchControlSize.Height = WatchControlLayout.HeightWatchControl;
            #endregion - [WatchControlSize Definitions] -

            // Instantiate the class that helps manage the user controls.
            m_WatchControlLayout = new WatchControlLayout(this);

            ConfigureDisplayPanel(m_Workset, m_TabPage1, m_WatchControlSize);
        }