private void DisplayLoopCondition(Kernel.Domain.LoopCondition loopCondition, bool readOnly = false) { trow = false; this.CommentTextBlock.Text = loopCondition.comment; this.OperatorComboBox.SelectedItem = loopCondition.operatorType; this.OpenBracketComboBox.SelectedItem = loopCondition.openBracket; this.CloseBracketComboBox.SelectedItem = loopCondition.closeBracket; this.Index = loopCondition.position + 1; if (readOnly) { SetMainPanelReadOnly(readOnly); } CellProperty cell = loopCondition.cellProperty; if (cell == null) { cell = new CellProperty(); } this.LoopCalutedValue.ChangeEventHandler += onChange; this.LoopCalutedValue.periodPanel.DisplayPeriod(cell.period, false, readOnly); this.LoopCalutedValue.filterScopePanel.DisplayScope(cell.cellScope, false, readOnly); this.LoopCalutedValue.CellMeasurePanel.Display(cell.cellMeasure, readOnly); if (!string.IsNullOrEmpty(loopCondition.conditions)) { this.LoopCalutedValue.DisplayInstructions(loopCondition.instructions, readOnly); } trow = true; }
public void OnDeleteConditionItem(object item) { if (item is UIElement) { this.LoopConditionsPanel.Children.Remove((UIElement)item); if (this.LoopConditionsPanel.Children.Count == 0) { OnAddConditionItem(null); } else { LoopConditionItemPanel panel = (LoopConditionItemPanel)this.LoopConditionsPanel.Children[0]; panel.OperatorComboBox.IsEnabled = false; panel.OperatorComboBox.SelectedItem = ""; //if (this.LoopUserTemplate != null) this.LoopUserTemplate.SynchronizeDeleteLoopCondition(panel.LoopCondition); } int index = 1; foreach (object pan in this.LoopConditionsPanel.Children) { ((LoopConditionItemPanel)pan).Index = index++; } } if (item is LoopConditionItemPanel) { Kernel.Domain.LoopCondition loopcondition = ((LoopConditionItemPanel)item).LoopCondition; if (this.LoopUserTemplate == null || loopcondition == null) { return; } this.LoopUserTemplate.SynchronizeDeleteLoopCondition(loopcondition); this.ActiveLoopConditionItemPanel.LoopCondition = loopcondition; } }
private void OnUpdateConditionLoop(object item) { if (item is Kernel.Domain.LoopCondition) { Kernel.Domain.LoopCondition loopcondition = ((Kernel.Domain.LoopCondition)item); loopcondition = this.Loop.SynchronizeLoopCondition(loopcondition); this.ActiveLoopConditionItemPanel.LoopCondition = loopcondition; } }
private void OnUpdateConditionLoop(object item) { if (item is Kernel.Domain.LoopCondition) { Kernel.Domain.LoopCondition loopcondition = ((Kernel.Domain.LoopCondition)item); if (this.LoopUserTemplate == null) { this.LoopUserTemplate = new LoopUserDialogTemplate(); } loopcondition = this.LoopUserTemplate.SynchronizeLoopCondition(loopcondition); this.ActiveLoopConditionItemPanel.LoopCondition = loopcondition; } }
protected void FillLoopCondition() { foreach (UIElement panel in this.LoopConditionsPanel.Children) { if (!(panel is LoopConditionItemPanel)) { continue; } if (((LoopConditionItemPanel)panel).LoopCondition == null) { continue; } Kernel.Domain.LoopCondition loopCondition = ((LoopConditionItemPanel)panel).FillConditions(this.TransformationTreeService); if (!loopCondition.isConditionsEmpty()) { this.Loop.SynchronizeLoopCondition(loopCondition); } } }
private void OnDeleteConditionItem(object item) { Kernel.Domain.LoopCondition loopcondition = null; LoopConditionItemPanel panel = null; if (item is UIElement) { if (item is LoopConditionItemPanel) { panel = (LoopConditionItemPanel)item; loopcondition = panel.LoopCondition; } this.LoopConditionsPanel.Children.Remove((UIElement)panel); if (this.LoopConditionsPanel.Children.Count == 0) { OnAddConditionItem(null); } int index = 1; foreach (object pan in this.LoopConditionsPanel.Children) { ((LoopConditionItemPanel)pan).Index = index++; } ((LoopConditionItemPanel)this.LoopConditionsPanel.Children[0]).OperatorComboBox.IsEnabled = false; } if (item is Kernel.Domain.LoopCondition) { loopcondition = ((Kernel.Domain.LoopCondition)item); } if (loopcondition == null) { return; } this.Loop.SynchronizeDeleteLoopCondition(loopcondition); }