Пример #1
0
 public InputControl(Input input)
 {
     InitializeComponent();
     _input = input;
     InputTitle = _input.Title;
     InputValue = _input.DefaultValue;
     IsSelected = _input.Enabled;
     RefreshView();
 }
Пример #2
0
 public static BaseInputControl Create(Input input)
 {
     switch (input.Type)
     {
         case InputType.Bool:
             return new BoolInputControl(input);
         case InputType.Date:
             return new DateInputControl(input);
         case InputType.Text:
             return new InputControl(input);
         default:
             throw new InvalidOperationException("Unsupported type: " + input.Type);
     }
 }