private DialogResult LaunchNumberEdit(ValueButton button, ValueParameter valueParameter)
      {
         NumberEntryForm numberEntryForm = new NumberEntryForm();
         this.SetDialogLocation(button, numberEntryForm);

         numberEntryForm.Title = button.Text;
         numberEntryForm.Unit = valueParameter.Unit;
         numberEntryForm.PostDecimalDigitCount = valueParameter.Precision;
         numberEntryForm.PresentValue = valueParameter.OperationalValue;
         numberEntryForm.DefaultValue = valueParameter.DefaultValue;
         numberEntryForm.MinimumValue = valueParameter.MinimumValue;
         numberEntryForm.MaximumValue = valueParameter.MaximumValue;

         this.DimBackground();
         DialogResult result = numberEntryForm.ShowDialog();
         this.LightBackground();

         if (result == System.Windows.Forms.DialogResult.OK)
         {
            valueParameter.OperationalValue = numberEntryForm.EnteredValue;
            button.ValueText = this.GetValueText(valueParameter);
         }

         return (result);
      }
      private void LoggingPortValueButton_Click(object sender, EventArgs e)
      {
         NumberEntryForm numberEntryForm = new NumberEntryForm();
         this.SetDialogLocation(this.LoggingPortValueButton, numberEntryForm);

         numberEntryForm.Title = "LOGGING PORT";
         numberEntryForm.Unit = "";
         numberEntryForm.PostDecimalDigitCount = 0;
         numberEntryForm.PresentValue = ParameterAccessor.Instance.Trace.Port;
         numberEntryForm.DefaultValue = 10000; ;
         numberEntryForm.MinimumValue = 1;
         numberEntryForm.MaximumValue = 65535;

         this.DimBackground();
         DialogResult result = numberEntryForm.ShowDialog();
         this.LightBackground();

         if (result == System.Windows.Forms.DialogResult.OK)
         {
            ParameterAccessor.Instance.Trace.Port = (int)(numberEntryForm.EnteredValue);
            this.LoggingPortValueButton.ValueText = ParameterAccessor.Instance.Trace.Port.ToString();
            this.SetTraceListenerDestination();
         }
      }
Beispiel #3
0
      private DialogResult LaunchNumberEdit(ref double value, Control control, string title, int postDecimalDigitCount, string unit, double defaultValue, double mimimumValue, double maximumValue)
      {
         NumberEntryForm numberEntryForm = new NumberEntryForm();
         this.SetDialogLocation(control, numberEntryForm);

         numberEntryForm.Title = title;
         numberEntryForm.PostDecimalDigitCount = postDecimalDigitCount;
         numberEntryForm.Unit = unit;
         numberEntryForm.PresentValue = value;
         numberEntryForm.DefaultValue = defaultValue;
         numberEntryForm.MinimumValue = mimimumValue;
         numberEntryForm.MaximumValue = maximumValue;

         this.DimBackground();
         DialogResult result = numberEntryForm.ShowDialog();
         this.LightBackground();
         value = numberEntryForm.EnteredValue;

         return (result);
      }
      private DialogResult LaunchNumberEdit(Control control, string title)
      {         
         NumberEntryForm numberEntryForm = new NumberEntryForm();
         this.SetDialogLocation(control, numberEntryForm);

         numberEntryForm.Title = title;
         numberEntryForm.Unit = this.IntensityValue.Unit;
         numberEntryForm.PostDecimalDigitCount = this.IntensityValue.Precision;
         numberEntryForm.PresentValue = this.IntensityValue.OperationalValue;
         numberEntryForm.DefaultValue = this.IntensityValue.DefaultValue;
         numberEntryForm.MinimumValue = this.IntensityValue.MinimumValue;
         numberEntryForm.MaximumValue = this.IntensityValue.MaximumValue;

         DialogResult result = numberEntryForm.ShowDialog();

         if (System.Windows.Forms.DialogResult.OK == result)
         {
            this.IntensityValue.OperationalValue = numberEntryForm.EnteredValue;
         }

         return (result);
      }
Beispiel #5
0
      private DialogResult LaunchNumberEdit(Control control, string title, ValueParameter valueParameter)
      {
         NumberEntryForm numberEntryForm = new NumberEntryForm();
         this.SetDialogLocation(control, numberEntryForm);
         
         numberEntryForm.Title = title;
         numberEntryForm.Unit = valueParameter.Unit;
         numberEntryForm.PostDecimalDigitCount = valueParameter.Precision;
         numberEntryForm.PresentValue = valueParameter.OperationalValue;
         numberEntryForm.DefaultValue = valueParameter.DefaultValue;
         numberEntryForm.MinimumValue = valueParameter.MinimumValue;
         numberEntryForm.MaximumValue = valueParameter.MaximumValue;

         this.DimBackground();
         DialogResult result = numberEntryForm.ShowDialog();
         this.LightBackground();

         if (System.Windows.Forms.DialogResult.OK == result)
         {
            valueParameter.OperationalValue = numberEntryForm.EnteredValue;
         }

         return (result);
      }