private void indexItemControl_OnAdd()
        {
            var form = new ValueForm();

            var value = new Value();

            //--- Need to determine if it is a collection/indexed array/Datum
            DatumType datum = Datum.GetDatumFromType(cmbIndexType);

            datum.standardUnit        = standardUnitControl.StandardUnit;
            datum.nonStandardUnit     = edtNonStandardUnit.Text;
            datum.Confidence          = edtConfidence.GetValue <double>();
            datum.ConfidenceSpecified = chkConfidence.Checked;
            datum.Resolution          = edtResolution.GetValue <double>();
            datum.ResolutionSpecified = chkResolution.Checked;
            value.Item           = datum;
            form.LockTypes       = true;
            form.Value           = value;
            form.DefaultDataType = cmbIndexType.SelectedIndex;
            if (DialogResult.OK == form.ShowDialog())
            {
                value = form.Value;
                if (value != null)
                {
                    var lvi = new ListViewItem(value.ToString());
                    lvi.Tag = value;
                    indexItemControl.Items.Add(lvi);
                }
            }
        }
        private void btnExpectedLimit_Click(object sender, EventArgs e)
        {
            var form = new ValueForm();

            form.Value = _limitMask.Expected;
            if (DialogResult.OK == form.ShowDialog())
            {
                Value value = form.Value;
                edtExpectedValue.Tag  = value;
                edtExpectedValue.Text = value.ToString();
            }
        }
示例#3
0
        public static string GetStringFromDialog(
            string textBoxText = "",
            string labelText   = "Enter Value:",
            string buttonText  = "OK")
        {
            ValueForm valueForm = new ValueForm(textBoxText, labelText, buttonText);

            if (valueForm.ShowDialog(AccessScope <StroopMainForm> .content) == DialogResult.OK)
            {
                return(valueForm.StringValue);
            }
            return(null);
        }
 private void indexItemControl_OnEdit()
 {
     if (indexItemControl.HasSelected)
     {
         var          value = indexItemControl.SelectedObject as Value;
         ListViewItem lvi   = indexItemControl.SelectedListViewItem;
         if (value != null)
         {
             var form = new ValueForm();
             form.Value     = value;
             form.LockTypes = true;
             if (DialogResult.OK == form.ShowDialog())
             {
                 lvi.Tag = value;
                 lvi.SubItems[0].Text = value.ToString();
             }
         }
     }
 }