private void BuildTemplates() { string filename = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "IssueType.xml"); this._templateDoc = new XmlDocument(); this._templateDoc.Load(filename); foreach (XmlNode selectNode1 in this._templateDoc.SelectNodes("//issue")) { TabItem tabItem = new TabItem(); tabItem.Header = (object)selectNode1.SelectSingleNode("alias").InnerText; tabItem.DataContext = (object)selectNode1; this.AddChild((object)tabItem); IssuePropertiesList issuePropertiesList = new IssuePropertiesList(); tabItem.Content = (object)issuePropertiesList; foreach (XmlNode selectNode2 in selectNode1.SelectNodes("parameters/parameter")) { issuePropertiesList.AddItem(selectNode2); XmlDocument ownerDocument = selectNode2.OwnerDocument; if (selectNode2.Attributes["type"].Value == "combo") { XmlNode element = (XmlNode)ownerDocument.CreateElement("selected"); element.InnerText = "0"; selectNode2.AppendChild(element); } else { XmlNode element = (XmlNode)ownerDocument.CreateElement("value"); selectNode2.AppendChild(element); } } } }
public void PutIssueProperties(ref Issue issue) { IssuePropertiesList selectedContent = this.SelectedContent as IssuePropertiesList; issue.Template = (selectedContent.DataContext as XmlElement).SelectSingleNode("type").InnerText; selectedContent.PutIssueProperties(ref issue); }