コード例 #1
0
        /// <summary>
        /// Displays the current options editor instance
        /// </summary>
        public static void Display()
        {
            lock (_lock)
            {
                if (_instance == null)
                {
                    _instance = new OptionsEditor();
                }

                if (TrafficViewerOptions.Instance.MemoryBufferSize == 1 &&
                    TrafficViewerOptions.Instance.EstimatedLineSize == 1024)
                {
                    _instance._checkOptMemory.Checked = true;
                }
                _instance._numProxyPort.Value = (decimal)TrafficViewerOptions.Instance.ProxyPort;
                if (TrafficViewerOptions.Instance.ProxyMode == TrafficServerMode.Strict)
                {
                    _instance._checkProxyStrict.Checked = true;
                }

                //initialize the variable definitions list (in case is not set)
                TrafficViewerOptions.Instance.VariableDefinitions = TrafficViewerOptions.Instance.VariableDefinitions;

                //set the definitions list in a option grid format
                _instance._gridVarDefs.SetValues((List <string>)
                                                 TrafficViewerOptions.Instance.GetOption("VariableDefinitions"));

                //show the form
                _instance.ShowDialog();
            }
        }
コード例 #2
0
        private void OptionsClick(object sender, EventArgs e)
        {
            OptionsEditor editor = new OptionsEditor();

            editor.ShowDialog();
        }