示例#1
0
 public void SaveDocument()
 {
     if (_document != null)
     {
         DocumentManager.SaveDocument(_document);
         Modified = false;
         UndoRedo.EmptyUndoBuffer();
         OnTextChanged(null);
         CurrentPos = Tag != null ? (int)Tag : 0;
     }
 }
示例#2
0
 public void InitForXML()
 {
     ConfigurationManager.Language = "xml";
     MatchBraces       = true;
     IsBraceMatching   = true;
     Lexing.Lexer      = Lexer.Xml;
     Folding.IsEnabled = true;
     Lexing.SetProperty("fold", "1");
     Lexing.SetProperty("fold.html", "1");
     Margins[0].Width = 60;
     Margins[1].Width = 16;
     Margins[2].Width = 40;
     UndoRedo.EmptyUndoBuffer();
     Modified = false;
 }
示例#3
0
 public void InitForText()
 {
     ConfigurationManager.Language = "text";
     Indentation.ShowGuides        = false;
     MatchBraces       = false;
     IsBraceMatching   = false;
     Lexing.Lexer      = Lexer.Automatic;
     Folding.IsEnabled = false;
     Lexing.SetProperty("fold", "0");
     Lexing.SetProperty("fold.html", "0");
     Margins[0].Width = 40;
     Margins[1].Width = 16;
     Margins[2].Width = 40;
     UndoRedo.EmptyUndoBuffer();
     Modified = false;
 }
示例#4
0
        public void LoadFileText(FileInformation fileInfo, string text)
        {
            ResetEditor();
            this.Text = text;
            m_fileInfo.Filename.Assign(fileInfo.Filename);
            this.FileLocation = fileInfo.Location;

            UpdateSyntaxHighlighting();


            string filename = Path.GetFileName(this.Filename);

            string indicator = (this.FileLocation == FileLocation.Local) ? "L" : "R";

            string tabText = string.Format("({0}) {1}", indicator, filename);

            m_parentTab.Title = tabText;

            // do stuff with EOL here?

            UndoRedo.EmptyUndoBuffer();
        }
示例#5
0
 /// <summary>
 /// 加载Xml
 /// </summary>
 /// <param name="xml">XML</param>
 public void loadXml(String xml)
 {
     Text = xml;
     UndoRedo.EmptyUndoBuffer();
 }