private void UpdateXmlView(XmlDocument doc) { FlowDocument ObjFdoc = new FlowDocument(); Paragraph ObjPara1 = new Paragraph(); ObjPara1.Inlines.Add(new Run(XmlCreator.GetPrettyXml(doc))); ObjFdoc.Blocks.Add(ObjPara1); XmlFile.Document = ObjFdoc; }
private void ButtonBase3_OnClick(object sender, RoutedEventArgs e) { _xmlDocument = new XmlDocument(); _xmlDocument.Load(_manifestLocation); XmlNodeList list = _xmlDocument.GetElementsByTagName("update"); AppId.Text = (list[0] as XmlElement).GetAttribute("appId"); list = list[0].ChildNodes; foreach (XmlElement xmlElement in list) { string value = xmlElement.GetAttribute("value"); if (xmlElement.Name == "version") { Version.Text = value; } else if (xmlElement.Name == "url") { Url.Text = value; } else if (xmlElement.Name == "exe") { Exe.Text = value; } else if (xmlElement.Name == "description") { FlowDocument ObjFdoc = new FlowDocument(); Paragraph ObjPara1 = new Paragraph(); ObjPara1.Inlines.Add(value); ObjFdoc.Blocks.Add(ObjPara1); Description.Document = ObjFdoc; } else if (xmlElement.Name == "launchArgs") { FlowDocument ObjFdoc = new FlowDocument(); Paragraph ObjPara1 = new Paragraph(); ObjPara1.Inlines.Add(value); ObjFdoc.Blocks.Add(ObjPara1); Args.Document = ObjFdoc; } } FlowDocument ObjFdoc2 = new FlowDocument(); Paragraph ObjPara12 = new Paragraph(); ObjPara12.Inlines.Add(XmlCreator.GetPrettyXml(_xmlDocument)); ObjFdoc2.Blocks.Add(ObjPara12); XmlFile.Document = ObjFdoc2; }
private void ButtonBase_OnClick(object sender, RoutedEventArgs e) { _xmlDocument = XmlCreator.Create(); UpdateXmlView(_xmlDocument); }