public void LoadFile(string fileName)
        {
            Alt.GUI.ICSharpCode.TextEditor.TextEditorControl textEditorControl = TextEditorControl;
            if (textEditorControl == null)
            {
                return;
            }

            try
            {
                textEditorControl.LoadFile(fileName);
            }
            catch
            {
            }
        }
Пример #2
0
        internal static Alt.GUI.ICSharpCode.TextEditor.TextEditorControl Create_ICSharpCodeTextEditorControl()
        {
            Alt.GUI.ICSharpCode.TextEditor.TextEditorControl textEditorControl = new Alt.GUI.ICSharpCode.TextEditor.TextEditorControl();

            textEditorControl.BorderStyle = BorderStyle.None;

            textEditorControl.IsReadOnly = false;
            textEditorControl.Document.DocumentChanged +=
                new Alt.GUI.ICSharpCode.TextEditor.Document.DocumentEventHandler((sender, e) => {                 //SetModifiedFlag(editor, true);
            });

            // Alt.GUI.ICSharpCode.TextEditor doesn't have any built-in code folding
            // strategies, so I've included a simple one. Apparently, the
            // foldings are not updated automatically, so in this demo the user
            // cannot add or remove folding regions after loading the file.
            textEditorControl.Document.FoldingManager.FoldingStrategy = new RegionFoldingStrategy();
            textEditorControl.Document.FoldingManager.UpdateFoldings(null, null);

            return(textEditorControl);
        }