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; } }
public void initLoopConditionHandlers(LoopConditionItemPanel loopConditionItemPanel) { loopConditionItemPanel.Added += OnAddConditionItem; loopConditionItemPanel.Deleted += OnDeleteConditionItem; loopConditionItemPanel.ChangeEventHandler += OnChange; loopConditionItemPanel.Activated += OnActivate; loopConditionItemPanel.Updated += OnUpdateConditionLoop; }
public LoopConditionItemPanel GetNewConditionItemPanel(object item) { LoopConditionItemPanel panel = new LoopConditionItemPanel(); panel.Margin = new Thickness(0, 0, 0, 10); panel.Background = new SolidColorBrush(); panel.Display(item, this.IsReadOnly); //panel.Height = 250; initLoopConditionHandlers(panel); return(panel); }
public void OnAddConditionItem(object item) { LoopConditionItemPanel panel = GetNewConditionItemPanel(null); panel.SetReadOnly(this.IsReadOnly); int countContainerChildren = this.LoopConditionsPanel.Children.Count + 1; panel.Index = countContainerChildren; this.LoopConditionsPanel.Children.Add(panel); if (countContainerChildren == 1) { panel.OperatorComboBox.IsEnabled = false; panel.OperatorComboBox.SelectedItem = ""; } }
public void DisplayLoopCondition() { if (TransformationTreeService == null) { return; } this.LoopConditionsPanel.Children.Clear(); if (liste == null) { this.Loop.loopConditionsChangeHandler = new PersistentListChangeHandler <Kernel.Domain.LoopCondition>(); } if (liste.Count == 0) { OnAddConditionItem(null); return; } else { foreach (Kernel.Domain.LoopCondition condition in liste) { if (!string.IsNullOrEmpty(condition.conditions)) { condition.instructions = TransformationTreeService.getInstructionObject(condition.conditions); } LoopConditionItemPanel panel = GetNewConditionItemPanel(condition); if (condition.position == 0) { panel.OperatorComboBox.IsEnabled = false; panel.OperatorComboBox.SelectedItem = Operator.AND.ToString(); } this.LoopConditionsPanel.Children.Add(panel); } } }