コード例 #1
0
 private void CopyClipButtonClick(object sender, RoutedEventArgs e)
 {
     if (XmlDoc != null)
     {
         Clipboard.SetText(XmlDoc.BeautifyXml());
     }
 }
コード例 #2
0
        private void SaveToFileButton_OnClick(object sender, RoutedEventArgs e)
        {
            try
            {
                var fileSave = new SaveFileDialog
                {
                    Filter   = "Xml Files (*.xml)|*.xml",
                    FileName = "configuration.xml"
                };

                var saveResult = fileSave.ShowDialog();

                if (saveResult.HasValue && saveResult.Value)
                {
                    File.WriteAllText(fileSave.FileName, XmlDoc.BeautifyXml());
                }
            }
            catch (Exception ex)
            {
                ex.LogException();
            }
        }