예제 #1
0
 private void Document_FileActionOccurred(object sender, TextDocumentFileActionEventArgs e)
 {
     if (e.FileActionType == FileActionTypes.ContentSavedToDisk)
     {
         if (GenerateHtml.HtmlGenerationEnabled(e.FilePath))
         {
             GenerateHtml.GenerateHtmlFile(e.FilePath);
         }
     }
 }
예제 #2
0
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            Language = new MarkdownLanguage(this);

            var editorFactory = new EditorFactory(this, typeof(MarkdownLanguage).GUID);

            RegisterEditorFactory(editorFactory);

            await JoinableTaskFactory.SwitchToMainThreadAsync();

            _options = (Options)GetDialogPage(typeof(Options));

            Logger.Initialize(this, Vsix.Name);
            ErrorList.Initialize(this);
            CopyAsHtmlCommand.Initialize(this);
            AddCustomStylesheet.Initialize(this);
            GenerateHtml.Initialize(this);
        }
예제 #3
0
        protected override void Initialize()
        {
            _options = (Options)GetDialogPage(typeof(Options));

            Logger.Initialize(this, Vsix.Name);
            ErrorList.Initialize(this);
            CopyAsHtmlCommand.Initialize(this);
            AddCustomStylesheet.Initialize(this);
            GenerateHtml.Initialize(this);

            var serviceContainer = this as IServiceContainer;
            var langService      = new MarkdownLanguage(this);

            serviceContainer.AddService(typeof(MarkdownLanguage), langService, true);

            var editorFactory = new EditorFactory(this, typeof(MarkdownLanguage).GUID);

            RegisterEditorFactory(editorFactory);
        }
예제 #4
0
 public static void Initialize(Package package)
 {
     Instance = new GenerateHtml(package);
 }