Exemple #1
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;
        }
Exemple #2
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);
            }
        }