예제 #1
0
        private void OpenSVGFile()
        {
            ResetValue();
            using (OpenFileDialog openFileDialog = new OpenFileDialog())
            {
                openFileDialog.InitialDirectory = "c:\\";
                openFileDialog.Filter           = "*svg files (.svg)|*.svg";
                openFileDialog.RestoreDirectory = false;

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    Console.WriteLine(openFileDialog.FileName);
                    var filestream = openFileDialog.OpenFile();
                    using (StreamReader reader = new StreamReader(filestream))
                    {
                        string file;
                        file = reader.ReadToEnd();

                        if (file != null)
                        {
                            XmlDocument doc = new XmlDocument();
                            doc.LoadXml(file);
                            _fileContent = new ItemSvdData(doc.DocumentElement);
                        }
                    }
                }
            }
        }
예제 #2
0
 private void ResetValue()
 {
     _fileContent  = null;
     textBox1.Text = "";
 }