public ApplicationConfiguration()
        {
            Editor = new EditorConfiguration();
            Git    = new GitConfiguration();
            Images = new ImagesConfiguration();

            MarkdownOptions    = new MarkdownOptionsConfiguration();
            WindowPosition     = new WindowPositionConfiguration();
            FolderBrowser      = new FolderBrowserConfiguration();
            ApplicationUpdates = new ApplicationUpdatesConfiguration();
            OpenDocuments      = new List <OpenFileDocument>();


            InternalCommonFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Markdown Monster");
            CommonFolder         = InternalCommonFolder;
            LastFolder           = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            PreviewSyncMode = PreviewSyncMode.EditorToPreview;

            AutoSaveBackups   = true;
            AutoSaveDocuments = false;

            RecentDocumentsLength       = 10;
            RememberLastDocumentsLength = 5;


            //BugReportUrl = "https://markdownmonster.west-wind.com/bugreport/bugreport.ashx?method=ReportBug";
            //BugReportUrl = "http://localhost.fiddler/MarkdownMonster/bugreport/bugreport.ashx?method=ReportBug";
            //TelemetryUrl = "https://markdownmonster.west-wind.com/bugreport/bugreport.ashx?method=Telemetry";
            SendTelemetry = true;

            ApplicationTheme = Themes.Dark;
            PreviewTheme     = "Dharkan";
            EditorTheme      = "vscodedark";

            DefaultCodeSyntax = "csharp";

            PreviewHttpLinksExternal = true;

            UseMachineEncryptionKeyForPasswords = true;

            TerminalCommand     = "powershell.exe";
            TerminalCommandArgs = "-noexit -command \"cd '{0}'\"";
            OpenFolderCommand   = "explorer.exe";

            WebBrowserPreviewExecutable = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"Google\Chrome\Application\chrome.exe");

            ReportErrors = true;

            UseSingleWindow = true;

            IsPreviewVisible         = true;
            IsDocumentOutlineVisible = true;
            OpenInPresentationMode   = false;
            AlwaysUsePreviewRefresh  = false;

            // Disable for better stability and compatibility
            // We're not doing anything that pushes the hardware to bring benefits
            DisableHardwareAcceleration = true;
        }
        public ApplicationConfiguration()
        {
            Editor = new EditorConfiguration();
            Git    = new GitConfiguration();
            Images = new ImagesConfiguration();

            MarkdownOptions    = new MarkdownOptionsConfiguration();
            WindowPosition     = new WindowPositionConfiguration();
            FolderBrowser      = new FolderBrowserConfiguration();
            ApplicationUpdates = new ApplicationUpdatesConfiguration();
            PdfOutputWindow    = new  PdfOutputConfiguration();
            WebServer          = new WebServerConfiguration();
            System             = new SystemConfiguration();

            OpenDocuments = new List <OpenFileDocument>();

            // Make sure common folder points at AppData\Markdown Monster or PortableSettings
            InternalCommonFolder = FindCommonFolder();


            CommonFolder = InternalCommonFolder;
            LastFolder   = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            PreviewSyncMode = PreviewSyncMode.EditorToPreview;

            AutoSaveBackups   = true;
            AutoSaveDocuments = false;

            RecentDocumentsLength       = 10;
            RememberLastDocumentsLength = 5;


            //BugReportUrl = "https://markdownmonster.west-wind.com/bugreport/bugreport.ashx?method=ReportBug";
            //BugReportUrl = "http://localhost.fiddler/MarkdownMonster/bugreport/bugreport.ashx?method=ReportBug";
            //TelemetryUrl = "https://markdownmonster.west-wind.com/bugreport/bugreport.ashx?method=Telemetry";


            ApplicationTheme = Themes.Dark;
            PreviewTheme     = "Dharkan";
            EditorTheme      = "vscodedark";

            DefaultCodeSyntax = "csharp";

            PreviewHttpLinksExternal = true;

            UseMachineEncryptionKeyForPasswords = true;

            TerminalCommand     = "powershell.exe";
            TerminalCommandArgs = "-noexit -command \"cd '{0}'\"";
            OpenFolderCommand   = "explorer.exe";

            WebBrowserPreviewExecutable = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"Google\Chrome\Application\chrome.exe");
            UseSingleWindow             = true;

            IsPreviewVisible         = true;
            IsDocumentOutlineVisible = true;
            OpenInPresentationMode   = false;
            AlwaysUsePreviewRefresh  = false;
        }
        public ApplicationConfiguration()
        {
            MarkdownOptions    = new MarkdownOptionsConfiguration();
            WindowPosition     = new WindowPositionConfiguration();
            FolderBrowser      = new FolderBrowserConfiguration();
            ApplicationUpdates = new ApplicationUpdatesConfiguration();
            OpenDocuments      = new List <MarkdownDocument>();

            InternalCommonFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Markdown Monster");
            CommonFolder         = InternalCommonFolder;
            LastFolder           = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            PreviewSyncMode = PreviewSyncMode.EditorToPreview;

            AutoSaveBackups   = true;
            AutoSaveDocuments = false;

            RecentDocumentsLength       = 12;
            RememberLastDocumentsLength = 3;


            BugReportUrl = "https://markdownmonster.west-wind.com/bugreport/bugreport.ashx?method=ReportBug";
            //BugReportUrl = "http://localhost.fiddler/MarkdownMonster/bugreport/bugreport.ashx?method=ReportBug";
            TelemetryUrl  = "https://markdownmonster.west-wind.com/bugreport/bugreport.ashx?method=Telemetry";
            SendTelemetry = true;

            ApplicationTheme          = Themes.Dark;
            RenderTheme               = "Github";
            EditorTheme               = "twilight";
            EditorFont                = "Consolas";
            EditorFontSize            = 17;
            EditorWrapText            = true;
            EditorHighlightActiveLine = true;

            EditorEnableSpellcheck = true;
            EditorDictionary       = "EN_US";
            EditorKeyboardHandler  = "default"; // vim,emacs

            DefaultCodeSyntax = "csharp";

            PreviewHttpLinksExternal = true;

            UseMachineEncryptionKeyForPasswords = true;

            TerminalCommand     = "powershell.exe";
            TerminalCommandArgs = "-noexit -command \"cd '{0}'\"";
            OpenFolderCommand   = "explorer.exe";

            WebBrowserPreviewExecutable = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"Google\Chrome\Application\chrome.exe");

            ReportErrors = true;

            UseSingleWindow = true;

            IsPreviewVisible        = true;
            OpenInPresentationMode  = false;
            AlwaysUsePreviewRefresh = false;
        }
Esempio n. 4
0
        public ApplicationConfiguration()
        {
            MarkdownOptions    = new MarkdownOptionsConfiguration();
            WindowPosition     = new WindowPositionConfiguration();
            ApplicationUpdates = new ApplicationUpdatesConfiguration();
            OpenDocuments      = new List <MarkdownDocument>();

            InternalCommonFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Markdown Monster");
            CommonFolder         = InternalCommonFolder;
            LastFolder           = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);


            PreviewSyncMode = PreviewSyncMode.EditorAndPreview;

            AutoSaveBackups   = true;
            AutoSaveDocuments = false;

            RecentDocumentsLength       = 12;
            RememberLastDocumentsLength = 3;


            BugReportUrl = "https://markdownmonster.west-wind.com/bugreport/bugreport.ashx?method=ReportBug";
            //BugReportUrl = "http://localhost.fiddler/MarkdownMonster/bugreport/bugreport.ashx?method=ReportBug";
            TelemetryUrl  = "https://markdownmonster.west-wind.com/bugreport/bugreport.ashx?method=Telemetry";
            SendTelemetry = true;

            ApplicationTheme          = Themes.Dark;
            RenderTheme               = "Github";
            EditorTheme               = "twilight";
            EditorFont                = "Consolas";
            EditorFontSize            = 17;
            EditorWrapText            = true;
            EditorHighlightActiveLine = true;

            EditorEnableSpellcheck = true;
            EditorDictionary       = "EN_US";
            EditorKeyboardHandler  = "default"; // vim,emacs

            UseMachineEncryptionKeyForPasswords = true;

            OpenCommandLine   = "cmd.exe";
            OpenFolderCommand = "explorer.exe";

            ReportErrors = true;

            UseSingleWindow = false;

            IsPreviewVisible        = true;
            OpenInPresentationMode  = false;
            AlwaysUsePreviewRefresh = false;

            ImageEditor = @"C:\Program Files\paint.net\PaintDotNet.exe";
        }
        /// <summary>
        /// Builds the Markdig processing pipeline and returns a builder.
        /// Use this method to override any custom pipeline addins you want to
        /// add or append.
        ///
        /// Note you can also add addins using options.MarkdigExtensions which
        /// use MarkDigs extension syntax using commas instead of +.
        /// </summary>
        /// <param name="options"></param>
        /// <param name="builder"></param>
        /// <returns></returns>
        protected virtual MarkdownPipelineBuilder BuildPipeline(MarkdownOptionsConfiguration options, MarkdownPipelineBuilder builder)
        {
            if (options.AutoLinks)
            {
                builder = builder.UseAutoLinks();
            }
            if (options.AutoHeaderIdentifiers)
            {
                builder = builder.UseAutoIdentifiers();
            }
            if (options.Abbreviations)
            {
                builder = builder.UseAbbreviations();
            }

            if (options.StripYamlFrontMatter)
            {
                builder = builder.UseYamlFrontMatter();
            }
            if (options.EmojiAndSmiley)
            {
                builder = builder.UseEmojiAndSmiley();
            }
            if (options.MediaLinks)
            {
                builder = builder.UseMediaLinks();
            }
            if (options.ListExtras)
            {
                builder = builder.UseListExtras();
            }
            if (options.Figures)
            {
                builder = builder.UseFigures();
            }
            if (options.GithubTaskLists)
            {
                builder = builder.UseTaskLists();
            }
            if (options.SmartyPants)
            {
                builder = builder.UseSmartyPants();
            }
            if (options.Diagrams)
            {
                builder = builder.UseDiagrams();
            }

            if (UsePragmaLines)
            {
                builder = builder.UsePragmaLines();
            }

            try
            {
                if (!string.IsNullOrWhiteSpace(options.MarkdigExtensions))
                {
                    builder = builder.Configure(options.MarkdigExtensions.Replace(",", "+"));
                }
            }
            catch (ArgumentException ex)
            {
                // One or more of the extension options is invalid.
                mmApp.Log("Failed to load Markdig extensions: " + options.MarkdigExtensions + "\r\n" + ex.Message, ex);
            }

            return(builder);
        }
Esempio n. 6
0
        /// <summary>
        /// Builds the Markdig processing pipeline and returns a builder.
        /// Use this method to override any custom pipeline addins you want to
        /// add or append.
        ///
        /// Note you can also add addins using options.MarkdigExtensions which
        /// use MarkDigs extension syntax using commas instead of +.
        /// </summary>
        /// <param name="options"></param>
        /// <param name="builder"></param>
        /// <returns></returns>
        protected virtual MarkdownPipelineBuilder BuildPipeline(MarkdownOptionsConfiguration options, MarkdownPipelineBuilder builder)
        {
            if (options.AutoLinks)
            {
                builder = builder.UseAutoLinks();
            }
            if (options.AutoHeaderIdentifiers)
            {
                builder = builder.UseAutoIdentifiers(Markdig.Extensions.AutoIdentifiers.AutoIdentifierOptions.GitHub);
            }
            if (options.Abbreviations)
            {
                builder = builder.UseAbbreviations();
            }

            if (options.UseTables)
            {
                builder = builder
                          .UsePipeTables()
                          .UseGridTables();
            }

            if (options.StripYamlFrontMatter)
            {
                builder = builder.UseYamlFrontMatter();
            }
            if (options.EmojiAndSmiley)
            {
                builder = builder.UseEmojiAndSmiley(true);
            }
            if (options.MediaLinks)
            {
                builder = builder.UseMediaLinks();
            }
            if (options.ListExtras)
            {
                builder = builder.UseListExtras();
            }
            if (options.Figures)
            {
                builder = builder.UseFigures();
            }
            if (options.GithubTaskLists)
            {
                builder = builder.UseTaskLists();
            }
            if (options.SmartyPants)
            {
                builder = builder.UseSmartyPants();
            }
            if (options.Diagrams)
            {
                builder = builder.UseDiagrams();
            }
            if (options.CustomContainers)
            {
                builder = builder.UseCustomContainers();
            }
            if (options.Attributes)
            {
                builder = builder.UseGenericAttributes();
            }
            if (options.FootersAndFootnotes)
            {
                builder = builder
                          .UseFooters()
                          .UseFootnotes();
            }
            if (options.NoHtml)
            {
                builder = builder.DisableHtml();
            }

            builder = builder.UseEmphasisExtras();

            if (UsePragmaLines)
            {
                builder = builder.UsePragmaLines();
            }

            try
            {
                if (!string.IsNullOrWhiteSpace(options.MarkdigExtensions))
                {
                    builder = builder.Configure(options.MarkdigExtensions.Replace(",", "+"));
                }
            }
            catch (ArgumentException ex)
            {
                // One or more of the extension options is invalid.
                mmApp.Log("Failed to load Markdig extensions: " + options.MarkdigExtensions + "\r\n" + ex.Message, ex);

                // reset to default
                options.MarkdigExtensions = string.Empty;
                builder = builder.Configure(options.MarkdigExtensions.Replace(",", "+"));
            }

            return(builder);
        }
 /// <summary>
 /// Builds the Markdig processing pipeline and returns a builder.
 /// Use this method to override any custom pipeline addins you want to
 /// add or append.
 ///
 /// Note you can also add addins using options.MarkdigExtensions which
 /// use MarkDigs extension syntax using commas instead of +.
 /// </summary>
 /// <param name="options"></param>
 /// <param name="builder"></param>
 /// <returns></returns>
 protected virtual MarkdownPipelineBuilder BuildPipeline(MarkdownOptionsConfiguration options, MarkdownPipelineBuilder builder)
 {
     return(builder);
 }