Ejemplo n.º 1
0
        public void SetMethodOptions(MethodOptions methodOptions)
        {
            List <string> names = methodOptions.GetNames();

            for (int i = 0; i < names.Count; i++)
            {
                Label label = new Label();
                label.Name     = "label" + names[i];
                label.Text     = methodOptions.GetDescription(names[i]) + ":";
                label.AutoSize = true;
                label.Location = new Point(10, 20 + i * 25);
                labels.Add(label);
                Controls.Add(label);

                TextBox textBox = new TextBox();
                textBox.Name = "textBox" + names[i];

                object value = methodOptions.GetValue(names[i]);
                if (value is Double)
                {
                    textBox.Text = ((double)value).ToString(CultureInfo.InvariantCulture);
                }
                else
                {
                    textBox.Text = value.ToString();
                }

                textBox.Location = new Point(220, 20 + i * 25);
                textBoxes.Add(textBox);
                Controls.Add(textBox);
            }
        }
Ejemplo n.º 2
0
 public void GetMethodOptions(ref MethodOptions methodOptions)
 {
     for (int i = 0; i < textBoxes.Count; i++)
     {
         methodOptions.SetValue(textBoxes[i].Name.Substring(7), textBoxes[i].Text);
     }
 }
Ejemplo n.º 3
0
        private void toolStripMenuItemAnyMethod_Click(object sender, EventArgs e)
        {
            menuItemCurrentMethod.Checked = false;
            menuItemCurrentMethod         = (ToolStripMenuItem)sender;
            menuItemCurrentMethod.Checked = true;

            currentMethodName = menuItemCurrentMethod.Name.Substring(17);
            methodOptions     = ((Method)Activator.CreateInstance(methods[currentMethodName])).GetDefaultOptions();
            toolStripMenuItemSaveResults.Enabled = false;
        }
Ejemplo n.º 4
0
        public override void SetOptions(MethodOptions options)
        {
            base.SetOptions(options);

            internalMethod.L       = 1;
            internalMethod.Density = (int)options.GetValue("Density");
            internalMethod.Rv      = (double)options.GetValue("R");
            internalMethod.Reserve = 0.0;
            internalMethod.Kr      = 2000;
        }
Ejemplo n.º 5
0
 public void CopyTo(MethodOptions destination)
 {
     destination.descriptions = new Dictionary <string, string>(descriptions);
     destination.values       = new Dictionary <string, object>(values);
 }
Ejemplo n.º 6
0
 public virtual void SetOptions(MethodOptions options)
 {
     this.options = options;
     Reset();
 }