示例#1
0
        private void modalButton_Click(object sender, EventArgs e)
        {
            Visualizer v = new Visualizer();
            v.LoadXmlFromString("<xml>test</xml>");
            string modifiedXml = v.ShowDialog();

            MessageBox.Show(string.Format("Returned from Xml Visualizer v.2:\r\n{0}", modifiedXml));
        }
示例#2
0
 private void modelessButton_Click(object sender, EventArgs e)
 {
     Thread thread = new Thread(delegate(object textObject)
     {
         Visualizer v = new Visualizer();
         v.OnDisposeEvent += v_OnDisposeEvent;
         v.LoadXmlFromString(textObject.ToString());
         v.Show();
         v.Dispose();
     });
     thread.SetApartmentState(ApartmentState.STA);
     thread.Start("<xml>test</xml>");
 }
示例#3
0
        public static string ShowModal_LoadXmlFromFile(string fileName)
        {
            string modifiedXml;

            using (Visualizer visualizer = new Visualizer(false))
            {
                visualizer.LoadXmlFromFile(fileName);
                visualizer.ShowDialog();
                modifiedXml = visualizer.GetModifiedXml();
            }

            return modifiedXml;
        }
示例#4
0
        public static void ShowModeless_LoadXmlFromString(string xml)
        {
            ThreadStart threadDelegate = delegate
            {
                using (Visualizer visualizer = new Visualizer(false))
                {
                    visualizer.LoadXmlFromString(xml);
                    visualizer.Show();
                }
            };

            Thread thread = new Thread(threadDelegate);
            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();
        }
示例#5
0
        public static string ShowModal_LoadXmlFromString(string xml, bool replaceable, bool debugMode)
        {
            string modifiedXml;

            using (Visualizer visualizer = new Visualizer(debugMode))
            {
                visualizer.LoadXmlFromString(xml, replaceable);
                visualizer.ShowDialog();
                modifiedXml = visualizer.GetModifiedXml();
            }

            return modifiedXml;
        }