Exemplo n.º 1
0
 public static FrameworkElement Render(NumberInput input, RenderContext context)
 {
     if (context.Config.SupportsInteractivity)
     {
         var textBox = new TextBox()
         {
             Text = input.Value.ToString()
         };
         textBox.SetPlaceholder(input.Placeholder);
         textBox.Style = context.GetStyle($"Adaptive.Input.Text.Number");
         textBox.SetContext(input);
         context.InputBindings.Add(input.Id, () => textBox.Text);
         return(textBox);
     }
     else
     {
         Container container = TypedElementConverter.CreateElement <Container>();
         container.Separation = input.Separation;
         TextBlock textBlock = TypedElementConverter.CreateElement <TextBlock>();
         textBlock.Text = XamlUtilities.GetFallbackText(input) ?? input.Placeholder;
         container.Items.Add(textBlock);
         if (input.Value != double.NaN)
         {
             textBlock       = TypedElementConverter.CreateElement <TextBlock>();
             textBlock.Text  = input.Value.ToString();
             textBlock.Color = TextColor.Accent;
             textBlock.Wrap  = true;
             container.Items.Add(textBlock);
         }
         return(context.Render(container));
     }
 }
Exemplo n.º 2
0
        protected static HtmlTag NumberInputRender(TypedElement element, RenderContext context)
        {
            NumberInput input = (NumberInput)element;

            var uiNumberInput = new HtmlTag("input")
                                .Attr("name", input.Id)
                                .AddClass("ac-input")
                                .AddClass("ac-numberInput")
                                .Attr("type", "number")
                                .Style("width", "100%");

            if (!double.IsNaN(input.Min))
            {
                uiNumberInput.Attr("min", input.Min.ToString());
            }

            if (!double.IsNaN(input.Max))
            {
                uiNumberInput.Attr("max", input.Max.ToString());
            }

            if (!double.IsNaN(input.Value))
            {
                uiNumberInput.Attr("value", input.Value.ToString());
            }

            return(uiNumberInput);
        }
Exemplo n.º 3
0
        private NumberInput ReturnNumberInput(DataRow dr)
        {
            NumberInput ret = new NumberInput();

            SetTitle(ret, dr);
            return(ret);
        }
Exemplo n.º 4
0
        void input_Bookmark_TextChanged(object sender, EventArgs e)
        {
            if ((sender.GetType() == typeof(NumberInput)) && base.ControlMode == SPControlMode.Display)
            {
                input_Bookmark = sender as NumberInput;
                //SPListItem item = this.ListItem;

                url = SPContext.Current.Web.Url;
                //OpenElevatedWeb();

                if (web != null)
                {
                    BookmarkField.Bookmarks += 1;

                    web.AllowUnsafeUpdates = true;
                    SPListItem item = web.GetFile(this.ListItem.UniqueId).Item;
                    item[BuildFieldId.Bookmark] = BookmarkField;
                    item.SystemUpdate(false);
                    web.AllowUnsafeUpdates = false;
                }

                input_Bookmark.Value = BookmarkField.Bookmarks;
                input_Bookmark.Text  = BookmarkField.Bookmarks.ToString();
            }
        }
Exemplo n.º 5
0
        public static FrameworkElement Render(NumberInput input, RenderContext context)
        {
            if (context.Config.SupportsInteractivity)
            {
                IntegerUpDown numberPicker = new IntegerUpDown();
                // numberPicker.ShowButtonSpinner = true;

                if (!Double.IsNaN(input.Value))
                {
                    numberPicker.Value = Convert.ToInt32(input.Value);
                }

                if (!Double.IsNaN(input.Min))
                {
                    numberPicker.Minimum = Convert.ToInt32(input.Min);
                }

                if (!Double.IsNaN(input.Max))
                {
                    numberPicker.Minimum = Convert.ToInt32(input.Max);
                }

                numberPicker.Watermark   = input.Placeholder;
                numberPicker.Style       = context.GetStyle("Adaptive.Input.Number");
                numberPicker.DataContext = input;
                context.InputBindings.Add(input.Id, () => numberPicker.Value?.ToString());
                return(numberPicker);
            }
            else
            {
                var textBlock = TypedElementConverter.CreateElement <TextBlock>();
                textBlock.Text = XamlUtilities.GetFallbackText(input) ?? input.Placeholder;
                return(context.Render(textBlock));
            }
        }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Calculator = new Calculator();
     }
     NumberInput.Focus();
 }
        public override Empty ComputeLevel(NumberInput input)
        {
            var result = CalculateFibonacci(input.Number);

            State.MapContent[Context.Sender][input.Number] = result;

            return(new Empty());
        }
Exemplo n.º 8
0
 private void ConvertNumberInput(XmlWriter writer, NumberInput label)
 {
     HtmlBuilder.OpenElement(writer, "span")
     .OpenElement("input", "type", "text", "class", "form-control", "ng-model", GetExpressionBinding(label, false))
     .CloseElement()
     .CloseElement()
     .Complete();
 }
Exemplo n.º 9
0
 public StartingConditions GetResult()
 {
     return(new StartingConditions(
                NumberInput.DecodeQuantity(populationInput.Text).Value,
                (int)coloniesSelector.Value,
                NumberInput.DecodeQuantity(infrastructureInput.Text).Value,
                NewGameController.CustomStartNameKey));
 }
Exemplo n.º 10
0
        private void BtnRechnung_Click(object sender, RoutedEventArgs e)
        {
            DatePicker datum    = _zeileRechnung.Children[0] as DatePicker;
            ComboBox   laden    = _zeileRechnung.Children[1] as ComboBox;
            ComboBox   person   = _zeileRechnung.Children[2] as ComboBox;
            CheckBox   einmalig = _zeileRechnung.Children[3] as CheckBox;
            DateTime   date     = Convert.ToDateTime(datum.SelectedDate);

            CultureInfo      ci = new CultureInfo("DE-de");
            NumberFormatInfo ni = ci.NumberFormat;

            ni.NumberDecimalSeparator = ".";

            string result = "INSERT INTO `rechnung`(datum,laden,person,einmalig) VALUES ('";

            result += date.ToString("yyyy-MM-dd") + "'," + ((Shop)(laden.SelectedItem)).id + ","
                      + ((Person)(person.SelectedItem)).id + "," + Convert.ToInt32(einmalig.IsChecked) + ");";
            result += "INSERT INTO `ausgaben`(bezeichnung,betrag,prod_gr,rechnungsnr) VALUES ";

            List <TextBox> tb_list = new List <TextBox>();
            MySqlCommand   comm    = new MySqlCommand();
            int            i       = 1;

            foreach (var zeile in _rechnungsPosten.Children)
            {
                if (zeile is StackPanel)
                {
                    StackPanel  row = zeile as StackPanel;
                    TextBox     bez = row.Children[0] as TextBox;
                    NumberInput bet = row.Children[1] as NumberInput;
                    ComboBox    kat = row.Children[3] as ComboBox;
                    double      betrag;
                    if (bez.Text != "" && bez.Text != null)
                    {
                        betrag = Convert.ToDouble(bet.Text);
                        string b = string.Format(ni, "{0}", betrag);
                        // result += "('" +bez.Text + "'," + b + "," + ((Produktgruppe)kat.SelectedItem).id + ",LAST_INSERT_ID()),";
                        result += "(@bezeichnung" + i + ",@betrag" + i + "," + ((Produktgruppe)kat.SelectedItem).id + ",LAST_INSERT_ID()),";
                        MySqlParameter par_bez = new MySqlParameter("@bezeichnung" + i, MySqlDbType.VarChar);
                        par_bez.Value = bez.Text;
                        comm.Parameters.Add(par_bez);
                        MySqlParameter par_bet = new MySqlParameter("@betrag" + i, MySqlDbType.Double, 0);
                        par_bet.Value = betrag;
                        comm.Parameters.Add(par_bet);
                        i++;
                        // tb_list.Add(bez);
                        // tb_list.Add(bet.txtBox);
                    }
                }
            }

            result = result.Remove(result.Length - 1);
            //MessageBox.Show(result);
            comm.CommandText = result;

            int?rowsaffected = Insert?.Invoke(comm);
            // if(rowsaffected > 0) Clear(tb_list.ToArray());
        }
Exemplo n.º 11
0
        public override Empty InfiniteLoopFor(NumberInput input)
        {
            for (var i = 0; i < input.Number; i++)
            {
                CalculateFibonacci(10);
            }

            return(new Empty());
        }
Exemplo n.º 12
0
 public StartingConditions GetResult()
 {
     //TODO(v0.9) ignored number of buildings
     return(new StartingConditions(
                NumberInput.DecodeQuantity(populationInput.Text).Value,
                (int)coloniesSelector.Value,
                new StartingBuilding[0],
                NewGameController.CustomStartNameKey));
 }
Exemplo n.º 13
0
    public static void Main(string[] args)
    {
        TextInput input = new NumberInput();

        input.Add('1');
        input.Add('a');
        input.Add('0');

        Console.WriteLine(input.GetValue());
        Console.ReadLine();
    }
        protected void Handle_Enter(object sender, EventArgs e)
        {
            Decimal entry;

            if (Decimal.TryParse(NumberInput.Text, out entry))
            {
                MainCalculator.Push(entry);
                NumberInput.Text = "";
                NumberInput.Focus();
            }
            ErrorMessage.Text = string.Empty;
        }
Exemplo n.º 15
0
        public override NumberOutput QueryFibonacci(NumberInput input)
        {
            Assert(input.Number < 50, $"Query number should less than 50. actual number: {input.Number}");

            var result = CalculateFibonacci(input.Number);

            return(new NumberOutput
            {
                Number = input.Number,
                Result = result
            });
        }
Exemplo n.º 16
0
 public void restartYes()
 {
     restartPanel.SetActive(false);
     correctSolutionPanel.SetActive(false);
     init         = false;
     clickedValue = "";
     btnType      = 9;
     chosenValue  = 0;
     cellClicked  = null;
     squares.Clear();
     rows.Clear();
     columns.Clear();
     cellValues.Clear();
 }
Exemplo n.º 17
0
		private void capacityInput_TextChanged(object sender, EventArgs e)
		{
			var quantity = NumberInput.DecodeQuantity(this.capacityInput.Text);
			if (quantity.HasValue && quantity.Value < 0)
				quantity = null;

			if (quantity.HasValue)
			{
				this.controller.TargetTransportCapacity = quantity.Value;
				this.capacityInput.BackColor = SystemColors.Window;
			}
			else
				this.capacityInput.BackColor = Color.LightPink;
		}
Exemplo n.º 18
0
        private NumberInput GenerateNumberInput()
        {
            NumberInput numbrInput = new NumberInput
            {
                Width  = 40,
                Height = 20,
                Min    = Min,
                Max    = Max
            };
            Binding binding = new Binding("Value")
            {
                Mode = BindingMode.TwoWay
            };

            numbrInput.SetBinding(NumberInput.ValueProperty, binding);
            return(numbrInput);
        }
Exemplo n.º 19
0
        public override Empty InfiniteLoopWhile(NumberInput input)
        {
            var count = input.Number;

            while (true)
            {
                count--;
                if (count <= 0)
                {
                    break;
                }

                CalculateFibonacci(10);
            }

            return(new Empty());
        }
Exemplo n.º 20
0
        protected void BuildParameter(GraphParameterValue v)
        {
            try
            {
                PropertyInfo info2 = v.GetType().GetProperty("Value");

                if (v.Value is double || v.Value is float || v.Value is int)
                {
                    if (v.Value is double)
                    {
                        NumberInput np = new NumberInput(NumberInputType.Float, v, info2);
                        Stack.Children.Add(np);
                    }
                    else if (v.Value is float)
                    {
                        NumberInput np = new NumberInput(NumberInputType.Float, v, info2);
                        Stack.Children.Add(np);
                    }
                    else if (v.Value is int)
                    {
                        NumberInput np = new NumberInput(NumberInputType.Int, v, info2);
                        Stack.Children.Add(np);
                    }
                }
                else if (v.Value is bool || v.Type == NodeType.Bool)
                {
                    ToggleControl tc = new ToggleControl(v.Name, info2, v);
                    Stack.Children.Add(tc);
                }
                else if (v.Type == NodeType.Float2 || v.Type == NodeType.Float3 || v.Type == NodeType.Float4)
                {
                    VectorSlider vs = new VectorSlider(info2, v, v.Min, v.Max, v.Type);
                    Stack.Children.Add(vs);
                }
                else if (v.Value is MVector || v.Type == NodeType.Color || v.Type == NodeType.Gray)
                {
                    ColorSelect cs = new ColorSelect(info2, v);
                    Stack.Children.Add(cs);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }
        }
Exemplo n.º 21
0
        protected static HtmlTag NumberInputRender(TypedElement element, RenderContext context)
        {
            NumberInput input     = (NumberInput)element;
            var         container = new Container {
                Separation = input.Separation
            };

            container.Items.Add(new TextBlock {
                Text = GetFallbackText(input) ?? input.Placeholder
            });
            if (!double.IsNaN(input.Value))
            {
                container.Items.Add(new TextBlock
                {
                    Text  = input.Value.ToString(),
                    Color = TextColor.Accent,
                    Wrap  = true
                });
            }
            return(context.Render(container));
        }
Exemplo n.º 22
0
        private static void CreateGame()
        {
            int      typeSelection = MultipleChoice.Show("Select game", GameTypeMethods.GetAllFullNames()) + 1;
            GameType gameType      = (GameType)Enum.GetValues(typeof(GameType)).GetValue(typeSelection);

            Console.WriteLine();

            int players =
                NumberInput.Show("How many players", gameType.Minimum(), gameType.Maximum());

            Console.Clear();

            string[] names = LineEditor.RequestStringBatch("Enter player names", players);
            Console.Clear();

            if (names != null)
            {
                dynamic game = gameType.CreateGame(names);
                MainMenu(game);
            }
        }
Exemplo n.º 23
0
        private void AnalysButton_Click(object sender, RoutedEventArgs e)
        {
            if (!BigInteger.TryParse(NumberInput.Text, out var number))
            {
                var result = MessageBox.Show("Incorrect input!", "Error", MessageBoxButton.OK);

                if (result == MessageBoxResult.OK)
                {
                    NumberInput.Clear();
                }

                return;
            }

            Busy.Visibility = Visibility.Visible;
            var primeResult = NumbersAnalys.AnalysNumber(number);

            var window = new PrimalityTestChoose(primeResult, number);

            Busy.Visibility = Visibility.Hidden;

            window.ShowDialog();
        }
Exemplo n.º 24
0
        private void quantityInput_TextChanged(object sender, EventArgs e)
        {
            if (ignoreEvents)
            {
                return;
            }

            ignoreEvents = true;

            var quantity = NumberInput.DecodeQuantity(quantityInput.Text);

            if (quantity.HasValue && (quantity.Value < 0 || quantity.Value > maximum))
            {
                quantity = null;
            }

            quantityInput.BackColor = quantity.HasValue ? validColor : invalidColor;
            if (quantity.HasValue)
            {
                this.quantitySlider.Value = (int)((quantity.Value / (double)maximum) * this.quantitySlider.Maximum);
            }
            ignoreEvents = false;
        }
Exemplo n.º 25
0
 public virtual void Visit(NumberInput inputNumber)
 {
 }
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btnCheckNumber   = new System.Windows.Forms.Button();
            this.lblResultMessage = new System.Windows.Forms.Label();
            this.label2           = new System.Windows.Forms.Label();
            this.answer           = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // btnCheckNumber
            //
            this.btnCheckNumber.Location = new System.Drawing.Point(42, 159);
            this.btnCheckNumber.Name     = "btnCheckNumber";
            this.btnCheckNumber.Size     = new System.Drawing.Size(211, 50);
            this.btnCheckNumber.TabIndex = 1;
            this.btnCheckNumber.Text     = "Введите число";
            this.btnCheckNumber.UseVisualStyleBackColor = true;
            this.btnCheckNumber.Click += new System.EventHandler(this.btnCheckNumber_Click);
            //
            // lblResultMessage
            //
            this.lblResultMessage.Location = new System.Drawing.Point(42, 260);
            this.lblResultMessage.Name     = "lblResultMessage";
            this.lblResultMessage.Size     = new System.Drawing.Size(211, 79);
            this.lblResultMessage.TabIndex = 5;
            this.lblResultMessage.Text     = "lblResultMessage";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(38, 67);
            this.label2.Name     = "label2";
            this.label2.Size     = new System.Drawing.Size(215, 20);
            this.label2.TabIndex = 3;
            this.label2.Text     = "Введите число от 1 до 100";
            //
            // answer
            //
            this.answer.AutoSize = true;
            this.answer.Location = new System.Drawing.Point(42, 270);
            this.answer.Name     = "answer";
            this.answer.Size     = new System.Drawing.Size(0, 20);
            this.answer.TabIndex = 4;
            //
            _inputForm = new NumberInput();
            //
            // Task2MainWindow
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
            this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize          = new System.Drawing.Size(360, 404);
            this.Controls.Add(this.answer);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.lblResultMessage);
            this.Controls.Add(this.btnCheckNumber);

            this.Name = "Task2MainWindow";
            this.Text = "Угадай число";
            this.ResumeLayout(false);
            this.PerformLayout();

            _inputForm.InputNumberEvent +=
                new NumberInput.InputNumberHandler(ReadInt);
        }
Exemplo n.º 27
0
 private void OnNumberInput()
 {
     NumberInput.Invoke();
 }
Exemplo n.º 28
0
        protected void BuildParameter(string parameter, GraphParameterValue v, Node n)
        {
            try
            {
                PropertyInfo info1 = n.GetType().GetProperty(parameter);
                PropertyInfo info2 = v.GetType().GetProperty("Value");

                if (info1 == null)
                {
                    if (v.Value is float)
                    {
                        NumberInput np = new NumberInput(NumberInputType.Float, v, info2);
                        Stack.Children.Add(np);
                    }
                    else if (v.Value is int)
                    {
                        NumberInput np = new NumberInput(NumberInputType.Int, v, info2);
                        Stack.Children.Add(np);
                    }
                    else if (v.Value is bool)
                    {
                        ToggleControl tc = new ToggleControl("True", info2, v);
                        Stack.Children.Add(tc);
                    }
                }
                else
                {
                    if (v.Value is float || v.Value is int)
                    {
                        SliderAttribute sl = info1.GetCustomAttribute <SliderAttribute>();

                        if (sl != null)
                        {
                            NumberSlider inp = new NumberSlider(sl, info2, v);
                            Stack.Children.Add(inp);
                        }
                        else if (v.Value is float)
                        {
                            NumberInput np = new NumberInput(NumberInputType.Float, v, info2);
                            Stack.Children.Add(np);
                        }
                        else if (v.Value is int)
                        {
                            NumberInput np = new NumberInput(NumberInputType.Int, v, info2);
                            Stack.Children.Add(np);
                        }
                    }
                    else if (v.Value is bool)
                    {
                        ToggleControl tc = new ToggleControl(v.Name, info2, v);
                        Stack.Children.Add(tc);
                    }
                    else if (v.Value is Vector4)
                    {
                        ColorSelect cs = new ColorSelect(info2, v);
                        Stack.Children.Add(cs);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }
        }
Exemplo n.º 29
0
        private void Properties_DoubleClick(object sender, EventArgs e)
        {
            if (properties.SelectedIndex == -1)
            {
                return;
            }

            switch (plugin.properties[properties.SelectedIndex])
            {
            //String property

            case PluginStringProperty psp:
                TextInput ti = new TextInput(
                    "Edit '" + psp.name + "'",
                    "Change the property value",
                    psp.value
                    );
                if (ti.ShowDialog() == DialogResult.OK)
                {
                    psp.value = ti.GetResult();
                }
                break;

            //Number property

            case PluginNumberProperty pnp:
                NumberInput ni = new NumberInput(
                    "Edit '" + pnp.name + "'",
                    "Change the property value",
                    pnp.value
                    );
                if (ni.ShowDialog() == DialogResult.OK)
                {
                    pnp.value = ni.GetResult();
                }
                break;

            //Bool property

            case PluginBoolProperty pbp:
                BoolInput bi = new BoolInput(
                    "Edit '" + pbp.name + "'",
                    "Change the property value",
                    pbp.value
                    );
                if (bi.ShowDialog() == DialogResult.OK)
                {
                    pbp.value = bi.GetResult();
                }
                break;
            }

            //Save new settings

            PluginSystem.SavePluginSettings(
                settingsLocation,
                enabled,
                plugin.properties
                );

            //Reload properties

            LoadProperties();
        }
Exemplo n.º 30
0
        protected UIElement BuildParamater(object owner, EditableAttribute edit, PropertyInfo v, PropertyInfo template = null)
        {
            if (v == null || owner == null || edit == null)
            {
                return(null);
            }

            if (template == null)
            {
                template = v;
            }

            switch (edit.Type)
            {
            case ParameterInputType.FloatInput:
                NumberInput nfp = new NumberInput();
                nfp.Set(NumberInputType.Float, owner, v);
                return(nfp);

            case ParameterInputType.FloatSlider:
                NumberSlider nfs = new NumberSlider();
                nfs.Ticks = edit.Ticks;
                nfs.Set(edit.Min, edit.Max, v, owner);
                return(nfs);

            case ParameterInputType.IntInput:
                NumberInput nip = new NumberInput();
                nip.Set(NumberInputType.Int, owner, v);
                return(nip);

            case ParameterInputType.IntSlider:
                NumberSlider nis = new NumberSlider();
                nis.Ticks = edit.Ticks;
                nis.IsInt = true;
                nis.Set(edit.Min, edit.Max, v, owner);
                return(nis);

            case ParameterInputType.Dropdown:
                DropdownAttribute da      = template.GetCustomAttribute <DropdownAttribute>();
                object[]          dvalues = null;
                if (template.PropertyType.IsEnum)
                {
                    dvalues = Enum.GetNames(template.PropertyType);
                }
                else if (v.PropertyType.Equals(typeof(string[])))
                {
                    dvalues = (string[])v.GetValue(owner);
                }
                if (da != null && da.Values != null && da.Values.Length > 0)
                {
                    dvalues = da.Values;
                }
                if (da != null)
                {
                    return(new DropDown(dvalues, owner, v, da.OutputProperty, da.IsEditable));
                }

                return(new DropDown(dvalues, owner, v));

            case ParameterInputType.Color:
                return(new ColorSelect(v, owner));

            case ParameterInputType.Curves:
                return(new UICurves(v, owner));

            case ParameterInputType.Levels:
                Imaging.RawBitmap raw = null;
                if (owner is ImageNode)
                {
                    byte[] bits = (owner as ImageNode).GetPreview(256, 256);
                    if (bits != null)
                    {
                        raw = new Imaging.RawBitmap(256, 256, bits);
                    }
                }
                return(new UILevels(raw, owner, v));

            case ParameterInputType.Map:
                object mo = v.GetValue(owner);
                if (mo is Dictionary <string, GraphParameterValue> && owner is GraphInstanceNode)
                {
                    return(new ParameterMap((owner as GraphInstanceNode).GraphInst, mo as Dictionary <string, GraphParameterValue>));
                }
                else if (mo is List <GraphParameterValue> && owner is Node)
                {
                    return(new ParameterMap(owner as Node, mo as List <GraphParameterValue>));
                }
                else if (mo is List <GraphParameterValue> )
                {
                    return(new ParameterMap(null, mo as List <GraphParameterValue>));
                }
                return(null);

            case ParameterInputType.MapEdit:
                object meo = v.GetValue(owner);
                if (meo is Dictionary <string, GraphParameterValue> && owner is Graph && !(owner is FunctionGraph))
                {
                    return(new GraphParameterEditor(owner as Graph, meo as Dictionary <string, GraphParameterValue>));
                }
                else if (meo is List <GraphParameterValue> && owner is Graph && !(owner is FunctionGraph))
                {
                    return(new CustomParameterEditor(owner as Graph));
                }
                else if (meo is List <FunctionGraph> && owner is Graph && !(owner is FunctionGraph))
                {
                    return(new CustomFunctionEditor(owner as Graph));
                }
                else if (meo is  Dictionary <string, FunctionGraph> && !(owner is FunctionGraph))
                {
                    return(new GraphFunctionEditor(owner as Graph));
                }
                return(null);

            case ParameterInputType.MeshFile:
                return(new FileSelector(v, owner, "Mesh Files|*.fbx;*.obj"));

            case ParameterInputType.ImageFile:
                return(new FileSelector(v, owner, "Image Files|*.png;*.jpg;*.tif;*.bmp;*.jpeg"));

            case ParameterInputType.GraphFile:
                return(new FileSelector(v, owner, "Materia Graph|*.mtg"));

            case ParameterInputType.Text:
                return(new PropertyInput(v, owner, template.GetCustomAttribute <ReadOnlyAttribute>() != null));

            case ParameterInputType.MultiText:
                return(new PropertyInput(v, owner, template.GetCustomAttribute <ReadOnlyAttribute>() != null, true));

            case ParameterInputType.Toggle:
                return(new ToggleControl(edit.Name, v, owner));

            case ParameterInputType.Gradient:
                return(new GradientEditor(v, owner));

            case ParameterInputType.Float2Input:
                return(new VectorInput(v, owner, NodeType.Float2));

            case ParameterInputType.Float2Slider:
                return(new VectorSlider(v, owner, edit.Min, edit.Max, NodeType.Float2));

            case ParameterInputType.Float3Input:
                return(new VectorInput(v, owner, NodeType.Float3));

            case ParameterInputType.Float3Slider:
                return(new VectorSlider(v, owner, edit.Min, edit.Max, NodeType.Float3));

            case ParameterInputType.Float4Input:
                return(new VectorInput(v, owner, NodeType.Float4));

            case ParameterInputType.Float4Slider:
                return(new VectorSlider(v, owner, edit.Min, edit.Max, NodeType.Float4));

            case ParameterInputType.Int2Input:
                return(new VectorInput(v, owner, NodeType.Float2, NumberInputType.Int));

            case ParameterInputType.Int2Slider:
                return(new VectorSlider(v, owner, edit.Min, edit.Max, NodeType.Float2, true));

            case ParameterInputType.Int3Input:
                return(new VectorInput(v, owner, NodeType.Float3, NumberInputType.Int));

            case ParameterInputType.Int3Slider:
                return(new VectorSlider(v, owner, edit.Min, edit.Max, NodeType.Float3, true));

            case ParameterInputType.Int4Input:
                return(new VectorInput(v, owner, NodeType.Float4, NumberInputType.Int));

            case ParameterInputType.Int4Slider:
                return(new VectorSlider(v, owner, edit.Min, edit.Max, NodeType.Float4, true));
            }

            return(null);
        }
Exemplo n.º 31
0
 private NumberInput ReturnNumberInput(DataRow dr)
 {
     NumberInput ret = new NumberInput();
     SetTitle(ret, dr);
     return ret;
 }