public RuleViewModel(RuleViewer viewer, ITestCase testCase) { this.View = viewer; this.testCase = testCase; this.Rules = new ObservableCollection <IXMLTransformRule>(Utils.FlattenTransformRules(this.testCase.rules)); Init(); }
public IncrementStringRuleProps(IncrementStringTransformRule rule, RuleViewer View) { InitializeComponent(); Rule = rule; Copy = (IXMLTransformRule)Rule.Clone(); this.View = View; this.View.Props = this; this.DataContext = Copy; }
public RemoveNodeRuleProps(RemoveNodeTransformRule rule, RuleViewer View) { InitializeComponent(); Rule = rule; Copy = (IXMLTransformRule)rule.Clone(); this.View = View; this.View.Props = this; this.DataContext = Copy; }
public SequenceStringRuleProps(SequenceTransformRule rule, RuleViewer View) { InitializeComponent(); Rule = rule; Copy = (IXMLTransformRule)rule.Clone(); this.View = View; this.View.Props = this; this.DataContext = Copy; ObservableValues = new ObservableCollection <string>(((SequenceTransformRule)Copy).Values); ListItems.ItemsSource = ObservableValues; }
public RuleTreeControl(RuleViewer View) { InitializeComponent(); this.View = View; this.XmlRoot = View.testCase.TransformedDocument.Root; // Create the virtual tree Boolean.TryParse(View.testCase.GetOption("DefaultExpanded"), out bool expanded); this.Root = new NodeVisualTreeElement(this.XmlRoot, 0, expanded); docTreeViewer.ItemsSource = new List <ITreeElement>() { Root }; NodeMap = new Dictionary <string, TreeViewItem>(); PreviousState = new Dictionary <string, ITreeElement>(); ActionQueue = new Stack <ITreeViewQueuedAction>(); }
public static void DrawRule(StackPanel panel, IXMLTransformRule rule, RuleViewer View) { switch (rule.RuleType) { case TransformRuleTypes.Fixed: DrawFixedRule(panel, (FixedStringTransformRule)rule, View); break; case TransformRuleTypes.Random: DrawRandomRule(panel, (RandomStringTransformRule)rule, View); break; case TransformRuleTypes.RandomInteger: DrawRandomIntRule(panel, (RandomIntegerTransformRule)rule, View); break; case TransformRuleTypes.RepeatNode: DrawRepeatNodeRule(panel, (RepeatNodeTransformRule)rule, View); break; case TransformRuleTypes.IncrementString: DrawIncrementRule(panel, (IncrementStringTransformRule)rule, View); break; case TransformRuleTypes.SequenceString: DrawSequenceRule(panel, (SequenceTransformRule)rule, View); break; case TransformRuleTypes.RemoveNode: DrawRemoveRule(panel, (RemoveNodeTransformRule)rule, View); break; default: break; } }
private static void DrawIncrementRule(StackPanel panel, IncrementStringTransformRule rule, RuleViewer View) { TreeViewItem selected_item = View.docTreeViewControl.SelectedItem as TreeViewItem; if (selected_item != null) { rule.CurrentValue = ((XmlNode)selected_item.DataContext).InnerText; } IncrementStringRuleProps drawer = new IncrementStringRuleProps(rule, View); panel.Children.Clear(); panel.Children.Add(drawer); }
private static void DrawRemoveRule(StackPanel panel, RemoveNodeTransformRule rule, RuleViewer View) { RemoveNodeRuleProps drawer = new RemoveNodeRuleProps(rule, View); panel.Children.Clear(); panel.Children.Add(drawer); }
private static void DrawRandomIntRule(StackPanel panel, RandomIntegerTransformRule rule, RuleViewer View) { RandomIntegerRuleProps drawer = new RandomIntegerRuleProps(rule, View); panel.Children.Clear(); panel.Children.Add(drawer); }
private static void DrawFixedRule(StackPanel panel, FixedStringTransformRule rule, RuleViewer View) { FixedStringRuleProps drawer = new FixedStringRuleProps(rule, View); panel.Children.Clear(); panel.Children.Add(drawer); }
private static void DrawSequenceRule(StackPanel panel, SequenceTransformRule rule, RuleViewer View) { SequenceStringRuleProps drawer = new SequenceStringRuleProps(rule, View); panel.Children.Clear(); panel.Children.Add(drawer); }