Esempio n. 1
0
 public void Dispose()
 {
     if (this.loader == null)
     {
         return;
     }
     this.loader.Dispose();
     this.loader = (Loader)null;
     this.textBufferFactoryProvider = (ITextBufferFactory)null;
     this.textEditorFactoryProvider = (ITextEditorFactory)null;
     this.editorCommandsProvider    = (IEditorOperationsProvider)null;
     this.undoManagerProvider       = (ITextBufferUndoManagerProvider)null;
     this.contentTypeRegistry       = (IContentTypeRegistry)null;
     this.squiggleProviderFactory   = (ISquiggleProviderFactory)null;
     this.completionBrokerMap       = (ICompletionBrokerMap)null;
     this.undoHistoryRegistry       = (IUndoHistoryRegistry)null;
 }
Esempio n. 2
0
 private void Initialize()
 {
     if (this.ready)
     {
         return;
     }
     if (this.loader == null)
     {
         this.loader = Loader.CreateLoader(((EditingService.CompiledCompositionEntryPoint)Delegate.CreateDelegate(typeof(EditingService.CompiledCompositionEntryPoint), Assembly.LoadFile(Path.Combine(Path.GetDirectoryName(Assembly.GetAssembly(typeof(EditingService)).Location), "Microsoft.Nautilus.Composition.dll")).EntryPoint))());
         this.loader.Initialize();
     }
     this.textBufferFactoryProvider = this.loader.GetService <ITextBufferFactory>();
     this.textEditorFactoryProvider = this.loader.GetService <ITextEditorFactory>();
     this.editorCommandsProvider    = this.loader.GetService <IEditorOperationsProvider>();
     this.undoManagerProvider       = this.loader.GetService <ITextBufferUndoManagerProvider>();
     this.contentTypeRegistry       = this.loader.GetService <IContentTypeRegistry>();
     this.squiggleProviderFactory   = this.loader.GetService <ISquiggleProviderFactory>();
     this.completionBrokerMap       = this.loader.GetService <ICompletionBrokerMap>();
     this.undoHistoryRegistry       = this.loader.GetService <IUndoHistoryRegistry>();
     this.contentTypeRegistry.AddContentType("text.xml", "XML", (IEnumerable <string>) new string[1]
     {
         "text"
     });
     this.contentTypeRegistry.AddContentType("text.xaml", "XAML", (IEnumerable <string>) new string[1]
     {
         "text"
     });
     this.contentTypeRegistry.AddContentType("text.C#", "C#", (IEnumerable <string>) new string[1]
     {
         "text"
     });
     this.contentTypeRegistry.AddContentType("text.VB", "VB", (IEnumerable <string>) new string[1]
     {
         "text"
     });
     this.contentTypeRegistry.AddContentType("text.JS", "JS", (IEnumerable <string>) new string[1]
     {
         "text"
     });
     this.ready = true;
 }
Esempio n. 3
0
            public ToDoLanguageServiceItem(BufferView b, ISquiggleProviderFactory squiggleProviderFactory)
            {
                this.bufferView = b;
                this.uri = this.bufferView.Buffer.Uri;
                this.squiggleProviderFactory = squiggleProviderFactory;
                this.squiggles = new List<ISquiggleAdornment>();
                this.textBuffer = this.bufferView.TextBuffer;
                this.reparseTimer = new Timer(Reparse, null, Timeout.Infinite, Timeout.Infinite);

                // Described in MGrammar in a Nutshell (http://msdn.microsoft.com/en-us/library/dd129870.aspx)
                // and in PDC 2008 talk "Building Textual DSLs with the "Oslo" Modeling Language" (32:00 mark).
                //
                this.parser = null;
                using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ToDo.mgx"))
                {
                    // Load image and instantiate a corresponding dynamic parser
                    this.parser = DynamicParser.LoadFromMgx(stream, "ToDo.Tasks4");
                }

                this.classifier = new ParserClassifier(parser, bufferView.Buffer.TextBuffer);

                this.bufferView.EditorInitialized += OnBufferViewEditorInitialized;
                this.textBuffer.Changed += (ignore1, ignore2) => { lock (l) { bufferDirty = true; } };
            }