static TextEditorFactory ()
		{
			AddinManager.AddExtensionNodeHandler ("/MonoDevelop/SourceEditor2/EditorFactory", delegate(object sender, ExtensionNodeEventArgs args) {
				switch (args.Change) {
				case ExtensionChange.Add:
					if (currentFactory == null)
						currentFactory = (ITextEditorFactory)args.ExtensionObject;
					break;
				}
			});
		}
Exemplo n.º 2
0
 public ViewModelFactory(IEventAggregator eventAggregator,
                         IChildViewModelService childViewModelService,
                         SettingsService settingsService, ITextEditorFactory textEditorFactory,
                         WikiEditSessionService sessionService)
 {
     _EventAggregator       = eventAggregator;
     _ChildViewModelService = childViewModelService;
     _SettingsService       = settingsService;
     _TextEditorFactory     = textEditorFactory;
     _SessionService        = sessionService;
 }
Exemplo n.º 3
0
 static TextEditorFactory()
 {
     AddinManager.AddExtensionNodeHandler("/MonoDevelop/Ide/Editor/EditorFactory", delegate(object sender, ExtensionNodeEventArgs args) {
         switch (args.Change)
         {
         case ExtensionChange.Add:
             if (currentFactory == null)
             {
                 currentFactory = (ITextEditorFactory)args.ExtensionObject;
             }
             break;
         }
     });
 }
Exemplo n.º 4
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;
 }
Exemplo n.º 5
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;
 }
Exemplo n.º 6
0
 public PageEditorViewModel(SettingsService settingsService,
                            ITextEditorFactory textEditorFactory,
                            WikiSiteViewModel wikiSite)
 {
     if (settingsService == null)
     {
         throw new ArgumentNullException(nameof(settingsService));
     }
     if (wikiSite == null)
     {
         throw new ArgumentNullException(nameof(wikiSite));
     }
     _SettingsService                  = settingsService;
     _TextEditorFactory                = textEditorFactory;
     SiteContext                       = wikiSite;
     autoRefetchTimer                  = new DispatcherTimer();
     relativeDatesUpdateTimer          = new DispatcherTimer();
     autoRefetchTimer.Tick            += AutoRefetchTimer_Tick;
     relativeDatesUpdateTimer.Interval = TimeSpan.FromSeconds(10);
     relativeDatesUpdateTimer.Tick    += (_, e) => UpdateRelativeDates();
     LoadSettings();
     settingsService.SettingsChangedEvent.Subscribe(LoadSettings);
 }