internal void ChangeElementType(string value) { if (value == "not" && SelectedElement.DataModel.ChildNodes.Count > 1) { MessageBox.Show("Cannot change to 'not' beacause a 'not' can only have one direct child", "QueueExchange Configuration"); OnPropertyChanged("XMLText"); View.DrawQXConfig(); return; } XmlNode newNode = this.DataModel.CreateElement(value); SelectedElement.DataModel.ParentNode.InsertAfter(newNode, SelectedElement.DataModel); foreach (XmlNode child in SelectedElement.DataModel.ChildNodes) { XmlNode move = child.CloneNode(true); newNode.AppendChild(move); } SelectedElement.DataModel.ParentNode.RemoveChild(SelectedElement.DataModel); ViewAttributesCommand.Execute(newNode); OnPropertyChanged("XMLText"); View.DrawQXConfig(); }
internal void ChangeFilterType(string value) { //"Data Contains Value", "Data Matches Regex.", "Data Minimum Length", "XPath Exists","XPath Equals", "Xpath Date Within Offset" string name = "contains"; if (value == "Data Contains Value") { name = "contains"; } if (value == "Data Equals Value") { name = "equals"; } if (value == "Data Matches Regex.") { name = "matches"; } if (value == "Data Minimum Length") { name = "length"; } if (value == "XPath Exists") { name = "xpexists"; } if (value == "XPath Equals") { name = "xpequals"; } if (value == "XPath Matches") { name = "xpmatches"; } if (value == "XPath Date Within Offset") { name = "dateRange"; } if (value == "Context Contains") { name = "contextContains"; } XmlNode newNode = this.DataModel.CreateElement(name); SelectedElement.DataModel.ParentNode.InsertAfter(newNode, SelectedElement.DataModel); SelectedElement.DataModel.ParentNode.RemoveChild(SelectedElement.DataModel); ViewAttributesCommand.Execute(newNode); OnPropertyChanged("XMLText"); View.DrawQXConfig(); }