Пример #1
0
        public IfComponentControl(IfComponentData data, IComponentValueStore valueStore)
        {
            InitializeComponent();
            this.Loaded    += IfComponentControl_Loaded;
            this.data       = data;
            this.valueStore = valueStore;

            textCondition.data        = data.conditionData;
            textTrue.data             = data.trueData;
            textFalse.data            = data.falseData;
            textCondition.valueStore  = valueStore;
            textTrue.valueStore       = valueStore;
            textFalse.valueStore      = valueStore;
            textCondition.placeholder = "if";
            textTrue.placeholder      = "then";
            textFalse.placeholder     = "else";

            connector = new ControlConnector();
            connector.HorizontalAlignment = HorizontalAlignment.Center;
            connector.VerticalAlignment   = VerticalAlignment.Center;
            this.AddVisualChild(connector);
            connector.InitConnectable(this);

            this.Unloaded += IfComponentControl_Unloaded;
        }
 public SpreadsheetRangeData(IComponentValueStore valueStore, SpreadsheetComponentData spreadsheet, string startId, string endId)
     : base(valueStore)
 {
     this.spreadsheet = spreadsheet;
     this.startId     = startId;
     this.endId       = endId;
 }
Пример #3
0
 public IfComponentData(IComponentValueStore valueStore, string id)
     : base(valueStore)
 {
     this.id = id;
     conditionData = new IfExpressionData(valueStore, GetConditionId());
     trueData = new IfExpressionData(valueStore, GetTrueId());
     falseData = new IfExpressionData(valueStore, GetFalseId());
 }
        public ShapeComponentControl(ShapeComponentData data, IComponentValueStore valueStore)
        {
            this.data       = data;
            this.valueStore = valueStore;

            InitializeComponent();
            this.Loaded       += ShapeComponentControl_Loaded;
            this.Unloaded     += ShapeComponentControl_Unloaded;
            textBox.data       = data;
            textBox.valueStore = valueStore;
        }
Пример #5
0
 public LoopComponentData(IComponentValueStore valueStore, string id)
     : base(valueStore, id)
 {
     parametersData = new ObservableCollection <LoopParameterData>();
     iterationsData = new ObservableCollection <LoopExpressionData>();
     // minimum number of parameter is 1
     AddParameter(null, false);
     // expression id is <id>_e, condition id is <id>_c
     expressionData = new LoopExpressionData(valueStore, GetExpressionId());
     conditionData  = new LoopExpressionData(valueStore, GetConditionId());
 }
        public ExpressionComponentControl(ExpressionComponentData data, IComponentValueStore valueStore)
        {
            this.data       = data;
            this.valueStore = valueStore;

            InitializeComponent();
            this.Loaded   += ExpressionComponentControl_Loaded;
            this.Unloaded += ExpressionComponentControl_Unloaded;

            textBox.Document.TextAlignment = TextAlignment.Center;
            textBox.data       = data;
            textBox.valueStore = valueStore;
        }
 /**
  *  constructor always create spreadsheet with 1 column and 1 row
  **/
 public SpreadsheetComponentData(IComponentValueStore valueStore, string id)
     : base(valueStore)
 {
     this.id           = id;
     rowIdGenerator    = new VariableNameGenerator("");
     columnIdGenerator = new VariableNameGenerator("");
     //rowIds = new List<string>();
     columnDatas = new List <SpreadsheetColumnData>();
     rowDatas    = new List <SpreadsheetRowData>();
     cells       = new ObservableCollection <List <SpreadsheetCellData> >();
     AddRow();
     AddColumn();
 }
 public MacroComponentControl(MacroComponentData data, IComponentValueStore valueStore)
 {
     this.data       = data;
     this.valueStore = valueStore;
     InitializeComponent();
     this.Loaded += MacroComponentControl_Loaded;
     TextBoxMasking.SetMask(textName, DataHelper.FunctionNameRegex);
     textExpression.Document.TextAlignment = TextAlignment.Center;
     textExpression.valueStore             = valueStore;
     textExpression.data         = data.expressionData;
     textName.Text               = data.Function;
     containerParams.ItemsSource = data.parametersData;
 }
        public SpreadsheetComponentControl(SpreadsheetComponentData data, IComponentValueStore valueStore)
        {
            InitializeComponent();
            this.Loaded          += SpreadsheetComponentControl_Loaded;
            this.Unloaded        += SpreadsheetComponentControl_Unloaded;
            this.data             = data;
            this.valueStore       = valueStore;
            this.grid.ItemsSource = data.cells;
            SetupColumns();

            connector = new ControlConnector();
            connector.HorizontalAlignment = HorizontalAlignment.Center;
            connector.VerticalAlignment   = VerticalAlignment.Center;
            this.AddVisualChild(connector);
            connector.InitConnectable(this);
        }
Пример #10
0
 public MacroComponentData(IComponentValueStore valueStore, string id, List <string> p = null, string expression = "")
     : base(valueStore, id)
 {
     if (p != null && p.Count > 0)
     {
         foreach (string paramName in p)
         {
             AddParameter(paramName, false);
         }
     }
     else
     {
         parametersData = new ObservableCollection <MacroParameterData>();
         // minimum number of parameter is 1
         AddParameter(null, false);
     }
     expressionData = new MacroExpressionData(valueStore, GetExpressionId(), expression);
 }
        public LoopComponentControl(LoopComponentData data, IComponentValueStore valueStore)
        {
            this.data       = data;
            this.valueStore = valueStore;
            InitializeComponent();
            this.Loaded += LoopComponentControl_Loaded;
            TextBoxMasking.SetMask(textName, DataHelper.FunctionNameRegex);
            textExpression.valueStore      = valueStore;
            textExpression.data            = data.expressionData;
            textCondition.valueStore       = valueStore;
            textCondition.data             = data.conditionData;
            textName.Text                  = data.Function;
            containerParams.ItemsSource    = data.parametersData;
            containerIterators.ItemsSource = data.iterationsData;

            textExpression.placeholder = "result";
            textCondition.placeholder  = "while";

            textName.LostFocus += textName_LostFocus;
        }
Пример #12
0
 public LoopExpressionData(IComponentValueStore valueStore, string id)
     : base(valueStore, id)
 {
 }
Пример #13
0
 public ShapeComponentData(IComponentValueStore valueStore, string id)
     : base(valueStore)
 {
     this.id     = id;
     connections = new HashSet <string>();
 }
Пример #14
0
 public RootComponentData(IComponentValueStore valueStore)
     : base(valueStore)
 {
 }
Пример #15
0
 public AbstractComponentData(IComponentValueStore valueStore)
 {
     this.valueStore = valueStore;
     InitDefaultStyle();
 }
Пример #16
0
 public ExpressionComponentData(IComponentValueStore valueStore, string id, string expression)
     : base(valueStore)
 {
     this.id     = id;
     _expression = expression;
 }
Пример #17
0
 public MacroExpressionData(IComponentValueStore valueStore, string id, string expression)
     : base(valueStore, id)
 {
     _expression = expression;
 }
Пример #18
0
 public AbstractMacroData(IComponentValueStore valueStore, string id)
     : base(valueStore)
 {
     _id = id;
 }
Пример #19
0
 public AbstractExpressionData(IComponentValueStore valueStore, string id)
     : base(valueStore)
 {
     _id         = id;
     _expression = "";
 }
Пример #20
0
 public MacroParameterData(IComponentValueStore valueStore)
     : base(valueStore)
 {
 }
Пример #21
0
 public SpreadsheetCellData(IComponentValueStore valueStore, string id, string expression = "")
     : base(valueStore, id)
 {
     _expression = expression;
 }
Пример #22
0
 public SpreadsheetRowData(IComponentValueStore valueStore)
     : base(valueStore)
 {
     expression = "";
 }
Пример #23
0
 public AbstractParameterData(IComponentValueStore valueStore)
     : base(valueStore)
 {
 }
Пример #24
0
 public IfExpressionData(IComponentValueStore valueStore, string id)
     : base(valueStore, id)
 {
     _expression = "";
 }
Пример #25
0
 public LoopParameterData(IComponentValueStore valueStore)
     : base(valueStore)
 {
 }