public TextDocument(TextBoxControl editor) { _editor = editor; EditorProperties = _editor.EditorProperties; _bookmarkManager = new BookmarkManager(this); XmlHeader = new VXmlHeader(this); //NodeRoot = new VXmlNode("RootNode", this); ReadOnly = false; NCalc = true; m_sFile = ""; }
public void LoadXml(string xml) { System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); try { doc.LoadXml(xml); XmlHeader = new VXmlHeader(this, doc.FirstChild); NodeRoot = new VXmlNode(this); NodeRoot.Init(doc.DocumentElement); m_sFile = ""; NCalc = true; } catch (System.Exception ex) { MessageBox.Show("读取XML字符串失败,请确认xml字符串是否正确。\n" + ex.Message); } }
public void Load(string file) { System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); try { _bookmarkManager.Clear(); doc.Load(file); XmlHeader = new VXmlHeader(this, doc.FirstChild); NodeRoot = new VXmlNode(this); NodeRoot.Init(doc.DocumentElement); m_sFile = file; NCalc = true; } catch (System.Exception ex) { MessageBox.Show("打开XML文件失败,请确认文件是否正确。\n" + ex.Message); } }