Exemplo n.º 1
0
 private Object GetValueFromControl(Control c)
 {
     Debug.Assert(!(c is Label));
     if (c is TextBox)
     {
         return((c as TextBox).Text);
     }
     else if (c is CheckBox)
     {
         return((c as CheckBox).Checked);
     }
     else if (c is ComboBox)
     {
         return((c as ComboBox).Text);
     }
     else if (c is FileInput)
     {
         FileInput  fi = c as FileInput;
         MatrixPath mp = new MatrixPath();
         mp.Path = fi.MatrixPath;
         mp.Size = fi.MatrixSize;
         return(mp);
     }
     else
     {
         Debug.Assert(false);
         return(null);
     }
 }
Exemplo n.º 2
0
        private void AddFileInputToParametersPanel(string text, FileInputType t, Object value, int x, int y)
        {
            FileInput fi = new FileInput();

            fi.Name     = text;
            fi.Type     = t;
            fi.Location = new Point(x, y * 30 + 5);
            if (value != null)
            {
                MatrixPath mp = (MatrixPath)value;
                fi.MatrixPath = mp.Path;
                fi.MatrixSize = mp.Size;
            }
            parametersPanel.Controls.Add(fi);
        }
        private void AddFileInputToParametersPanel(String text, FileInputType t, Object value, Int32 x, Int32 y)
        {
            FileInput fi = new FileInput
            {
                Name     = text,
                Type     = t,
                Location = new Point(x, y * 30 + 5)
            };

            if (value != null)
            {
                MatrixPath mp = (MatrixPath)value;
                fi.MatrixPath = mp.Path;
                fi.MatrixSize = mp.Size;
            }
            parametersPanel.Controls.Add(fi);
        }
 private void AddFileInputToParametersPanel(string text, FileInputType t, Object value, int x, int y)
 {
     FileInput fi = new FileInput();
     fi.Name = text;
     fi.Type = t;
     fi.Location = new Point(x, y * 30 + 5);
     if (value != null)
     {
         MatrixPath mp = (MatrixPath)value;
         fi.MatrixPath = mp.Path;
         fi.MatrixSize = mp.Size;
     }
     parametersPanel.Controls.Add(fi);
 }