Ejemplo n.º 1
0
        private void initDocument(Control parent, DesignerHost host)
        {
            System.Diagnostics.Trace.WriteLine("Creating document...");

            // get the ExtensibleTextEditor instance of the Source code's view
            textEditor = IdeApp.Workbench.ActiveDocument.PrimaryView.GetContent <SourceEditorView> ().TextEditor;

            if (!(parent is WebFormPage))
            {
                throw new NotImplementedException("Only WebFormsPages can have a document for now");
            }
            this.parent = parent;
            this.host   = host;

            if (!host.Loading)
            {
                throw new InvalidOperationException("The document cannot be initialised or loaded unless the host is loading");
            }

            directives            = new Hashtable(StringComparer.InvariantCultureIgnoreCase);
            txtDocDirty           = true;
            suppressSerialization = false;
            // create and set the event, to let the parser run the first time
            updateEditorContent = new ManualResetEvent(true);
            undoTracker         = new UndoTracker();
            undoHandler         = IdeApp.Workbench.ActiveDocument.PrimaryView.GetContent <IUndoHandler> ();
            if (undoHandler == null)
            {
                throw new NullReferenceException("Could not obtain the IUndoHandler from the SourceEditorView");
            }
        }
 public SemanticHighlightingSyntaxMode(ExtensibleTextEditor editor, ISyntaxMode syntaxMode, SemanticHighlighting semanticHighlighting)
 {
     if (editor == null)
     {
         throw new ArgumentNullException("editor");
     }
     if (syntaxMode == null)
     {
         throw new ArgumentNullException("syntaxMode");
     }
     if (semanticHighlighting == null)
     {
         throw new ArgumentNullException("semanticHighlighting");
     }
     this.editor = editor;
     this.semanticHighlighting = semanticHighlighting;
     this.syntaxMode           = syntaxMode as SyntaxMode;
     semanticHighlighting.SemanticHighlightingUpdated += SemanticHighlighting_SemanticHighlightingUpdated;
 }
Ejemplo n.º 3
0
 public IdeViMode(ExtensibleTextEditor editor, MonoDevelop.Ide.Gui.Document doc) :
     base(doc)
 {
     this.editor = editor;
     tabAction   = new TabAction(editor);
 }
Ejemplo n.º 4
0
 public NewIdeViMode(ExtensibleTextEditor editor)
 {
     this.editor = editor;
 }