├── .gitattributes
├── .gitignore
├── .gitmodules
├── Cli
├── App.config
├── Cli.csproj
├── MarkdigExtensions
│ └── VisualTaskLists
│ │ ├── HtmlVisualTaskListRenderer.cs
│ │ └── VisualTaskListExtension.cs
├── Program.cs
└── Properties
│ └── AssemblyInfo.cs
├── LICENSE.md
├── MarkdownViewerPlusPlus.sln
├── MarkdownViewerPlusPlus
├── DebounceDispatcher.cs
├── Forms
│ ├── AboutDialog.Designer.cs
│ ├── AboutDialog.cs
│ ├── AboutDialog.resx
│ ├── AbstractOptionsPanel.cs
│ ├── AbstractRenderer.Designer.cs
│ ├── AbstractRenderer.cs
│ ├── AbstractRenderer.resx
│ ├── MarkdownViewerHtmlPanel.cs
│ ├── MarkdownViewerOptions.Designer.cs
│ ├── MarkdownViewerOptions.cs
│ ├── MarkdownViewerOptions.resx
│ ├── MarkdownViewerRenderer.cs
│ ├── OptionsPanelGeneral.Designer.cs
│ ├── OptionsPanelGeneral.cs
│ ├── OptionsPanelGeneral.resx
│ ├── OptionsPanelHTML.Designer.cs
│ ├── OptionsPanelHTML.cs
│ └── OptionsPanelHTML.resx
├── Helper
│ └── ClipboardHelper.cs
├── ILMerge.props
├── ILMergeOrder.txt
├── Main.cs
├── MarkdigExtensions
│ └── VisualTaskLists
│ │ ├── HtmlVisualTaskListRenderer.cs
│ │ └── VisualTaskListExtension.cs
├── MarkdownViewer.cs
├── MarkdownViewerConfiguration.cs
├── MarkdownViewerPlusPlus.csproj
├── PluginInfrastructure
│ ├── ClikeStringArray.cs
│ ├── DllExport
│ │ ├── DllExportAttribute.cs
│ │ ├── Mono.Cecil.dll
│ │ ├── NppPlugin.DllExport.MSBuild.dll
│ │ ├── NppPlugin.DllExport.dll
│ │ └── NppPlugin.DllExport.targets
│ ├── Docking_h.cs
│ ├── GatewayDomain.cs
│ ├── IScintillaGateway.cs
│ ├── MenuCmdID_h.cs
│ ├── Msgs_h.cs
│ ├── NotepadPPGateway.cs
│ ├── NppPluginNETBase.cs
│ ├── NppPluginNETHelper.cs
│ ├── Preference_h.cs
│ ├── Resource_h.cs
│ ├── ScintillaGateway.cs
│ ├── Scintilla_iface.cs
│ ├── UnmanagedExports.cs
│ └── Win32.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Resources
│ ├── Donate-PayPal-green.png
│ ├── MarkdownViewerHTML.css
│ ├── MarkdownViewerPlusPlus-Options.png
│ ├── MarkdownViewerPlusPlus.png
│ ├── fa-clipboard-16x16.png
│ ├── fa-download-16x16.png
│ ├── fa-envelope-16x16.png
│ ├── fa-file-pdf-o-16x16.png
│ ├── fa-html5-16x16.png
│ ├── fa-print-16x16.png
│ ├── fa-refresh-16x16.png
│ ├── fa-tv-16x16.png
│ ├── fa-upload-16x16.png
│ ├── markdown-16x16-solid.bmp
│ └── markdown-16x16-solid.png
├── Windows
│ └── WindowsMessage.cs
├── app.config
└── packages.config
├── NuGet.Config
├── README.md
├── _config.yml
├── appveyor.yml
├── license
├── Apache-2.0-License.md
├── HtmlRenderer-License.md
├── Markdig-License.md
├── Ms-PL-License.md
├── OFL.txt
└── PDFSharp-License.md
└── style
├── .gitignore
├── gulpfile.js
├── package.json
├── pnpm-lock.yaml
└── sass
├── _extra.scss
├── _variables.scss
└── md.scss
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.suo
8 | *.user
9 | *.userosscache
10 | *.sln.docstates
11 |
12 | # User-specific files (MonoDevelop/Xamarin Studio)
13 | *.userprefs
14 |
15 | # Build results
16 | [Dd]ebug/
17 | [Dd]ebugPublic/
18 | [Rr]elease/
19 | [Rr]eleases/
20 | x64/
21 | x86/
22 | bld/
23 | [Bb]in/
24 | [Oo]bj/
25 | [Ll]og/
26 |
27 | # Visual Studio 2015 cache/options directory
28 | .vs/
29 | # Uncomment if you have tasks that create the project's static files in wwwroot
30 | #wwwroot/
31 |
32 | # MSTest test Results
33 | [Tt]est[Rr]esult*/
34 | [Bb]uild[Ll]og.*
35 |
36 | # NUNIT
37 | *.VisualState.xml
38 | TestResult.xml
39 |
40 | # Build Results of an ATL Project
41 | [Dd]ebugPS/
42 | [Rr]eleasePS/
43 | dlldata.c
44 |
45 | # .NET Core
46 | project.lock.json
47 | project.fragment.lock.json
48 | artifacts/
49 | **/Properties/launchSettings.json
50 |
51 | *_i.c
52 | *_p.c
53 | *_i.h
54 | *.ilk
55 | *.meta
56 | *.obj
57 | *.pch
58 | *.pdb
59 | *.pgc
60 | *.pgd
61 | *.rsp
62 | *.sbr
63 | *.tlb
64 | *.tli
65 | *.tlh
66 | *.tmp
67 | *.tmp_proj
68 | *.log
69 | *.vspscc
70 | *.vssscc
71 | .builds
72 | *.pidb
73 | *.svclog
74 | *.scc
75 |
76 | # Chutzpah Test files
77 | _Chutzpah*
78 |
79 | # Visual C++ cache files
80 | ipch/
81 | *.aps
82 | *.ncb
83 | *.opendb
84 | *.opensdf
85 | *.sdf
86 | *.cachefile
87 | *.VC.db
88 | *.VC.VC.opendb
89 |
90 | # Visual Studio profiler
91 | *.psess
92 | *.vsp
93 | *.vspx
94 | *.sap
95 |
96 | # TFS 2012 Local Workspace
97 | $tf/
98 |
99 | # Guidance Automation Toolkit
100 | *.gpState
101 |
102 | # ReSharper is a .NET coding add-in
103 | _ReSharper*/
104 | *.[Rr]e[Ss]harper
105 | *.DotSettings.user
106 |
107 | # JustCode is a .NET coding add-in
108 | .JustCode
109 |
110 | # TeamCity is a build add-in
111 | _TeamCity*
112 |
113 | # DotCover is a Code Coverage Tool
114 | *.dotCover
115 |
116 | # Visual Studio code coverage results
117 | *.coverage
118 | *.coveragexml
119 |
120 | # NCrunch
121 | _NCrunch_*
122 | .*crunch*.local.xml
123 | nCrunchTemp_*
124 |
125 | # MightyMoose
126 | *.mm.*
127 | AutoTest.Net/
128 |
129 | # Web workbench (sass)
130 | .sass-cache/
131 |
132 | # Installshield output folder
133 | [Ee]xpress/
134 |
135 | # DocProject is a documentation generator add-in
136 | DocProject/buildhelp/
137 | DocProject/Help/*.HxT
138 | DocProject/Help/*.HxC
139 | DocProject/Help/*.hhc
140 | DocProject/Help/*.hhk
141 | DocProject/Help/*.hhp
142 | DocProject/Help/Html2
143 | DocProject/Help/html
144 |
145 | # Click-Once directory
146 | publish/
147 |
148 | # Publish Web Output
149 | *.[Pp]ublish.xml
150 | *.azurePubxml
151 | # TODO: Comment the next line if you want to checkin your web deploy settings
152 | # but database connection strings (with potential passwords) will be unencrypted
153 | *.pubxml
154 | *.publishproj
155 |
156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
157 | # checkin your Azure Web App publish settings, but sensitive information contained
158 | # in these scripts will be unencrypted
159 | PublishScripts/
160 |
161 | # NuGet Packages
162 | *.nupkg
163 | # The packages folder can be ignored because of Package Restore
164 | **/packages/*
165 | # except build/, which is used as an MSBuild target.
166 | !**/packages/build/
167 | # Uncomment if necessary however generally it will be regenerated when needed
168 | #!**/packages/repositories.config
169 | # NuGet v3's project.json files produces more ignoreable files
170 | *.nuget.props
171 | *.nuget.targets
172 |
173 | # Microsoft Azure Build Output
174 | csx/
175 | *.build.csdef
176 |
177 | # Microsoft Azure Emulator
178 | ecf/
179 | rcf/
180 |
181 | # Windows Store app package directories and files
182 | AppPackages/
183 | BundleArtifacts/
184 | Package.StoreAssociation.xml
185 | _pkginfo.txt
186 |
187 | # Visual Studio cache files
188 | # files ending in .cache can be ignored
189 | *.[Cc]ache
190 | # but keep track of directories ending in .cache
191 | !*.[Cc]ache/
192 |
193 | # Others
194 | ClientBin/
195 | ~$*
196 | *~
197 | *.dbmdl
198 | *.dbproj.schemaview
199 | *.jfm
200 | *.pfx
201 | *.publishsettings
202 | node_modules/
203 | orleans.codegen.cs
204 |
205 | # Since there are multiple workflows, uncomment next line to ignore bower_components
206 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
207 | #bower_components/
208 |
209 | # RIA/Silverlight projects
210 | Generated_Code/
211 |
212 | # Backup & report files from converting an old project file
213 | # to a newer Visual Studio version. Backup files are not needed,
214 | # because we have git ;-)
215 | _UpgradeReport_Files/
216 | Backup*/
217 | UpgradeLog*.XML
218 | UpgradeLog*.htm
219 |
220 | # SQL Server files
221 | *.mdf
222 | *.ldf
223 |
224 | # Business Intelligence projects
225 | *.rdl.data
226 | *.bim.layout
227 | *.bim_*.settings
228 |
229 | # Microsoft Fakes
230 | FakesAssemblies/
231 |
232 | # GhostDoc plugin setting file
233 | *.GhostDoc.xml
234 |
235 | # Node.js Tools for Visual Studio
236 | .ntvs_analysis.dat
237 |
238 | # Visual Studio 6 build log
239 | *.plg
240 |
241 | # Visual Studio 6 workspace options file
242 | *.opt
243 |
244 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
245 | *.vbw
246 |
247 | # Visual Studio LightSwitch build output
248 | **/*.HTMLClient/GeneratedArtifacts
249 | **/*.DesktopClient/GeneratedArtifacts
250 | **/*.DesktopClient/ModelManifest.xml
251 | **/*.Server/GeneratedArtifacts
252 | **/*.Server/ModelManifest.xml
253 | _Pvt_Extensions
254 |
255 | # Paket dependency manager
256 | .paket/paket.exe
257 | paket-files/
258 |
259 | # FAKE - F# Make
260 | .fake/
261 |
262 | # JetBrains Rider
263 | .idea/
264 | *.sln.iml
265 |
266 | # CodeRush
267 | .cr/
268 |
269 | # Python Tools for Visual Studio (PTVS)
270 | __pycache__/
271 | *.pyc
272 |
273 | # Cake - Uncomment if you are using it
274 | # tools/**
275 | # !tools/packages.config
276 | /_site
277 | /Gemfile.lock
278 | /Gemfile
279 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "markdig"]
2 | path = markdig
3 | url = git@github.com:monoblaine/markdig.git
4 |
--------------------------------------------------------------------------------
/Cli/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Cli/Cli.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {2925EB4C-FD10-493F-9261-03C155B851EE}
8 | Exe
9 | MarkCLI
10 | MarkCLI
11 | v4.6.2
12 | 512
13 | true
14 | true
15 |
16 |
17 | x86
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 | ..\markdig\src\Markdig\bin\Release\net35\Markdig.dll
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/Cli/MarkdigExtensions/VisualTaskLists/HtmlVisualTaskListRenderer.cs:
--------------------------------------------------------------------------------
1 | using Markdig.Extensions.TaskLists;
2 | using Markdig.Renderers;
3 |
4 | namespace com.insanitydesign.MarkdownViewerPlusPlus.MarkdigExtensions.VisualTaskLists {
5 | public class HtmlVisualTaskListRenderer : HtmlTaskListRenderer {
6 | protected override void Write (HtmlRenderer renderer, TaskList obj) {
7 | if (renderer.EnableHtmlForInline) {
8 | renderer.Write("");
21 | }
22 | else {
23 | base.Write(renderer, obj);
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Cli/MarkdigExtensions/VisualTaskLists/VisualTaskListExtension.cs:
--------------------------------------------------------------------------------
1 | using Markdig;
2 | using Markdig.Extensions.TaskLists;
3 | using Markdig.Parsers.Inlines;
4 | using Markdig.Renderers;
5 | using Markdig.Renderers.Normalize;
6 |
7 | namespace com.insanitydesign.MarkdownViewerPlusPlus.MarkdigExtensions.VisualTaskLists {
8 | public class VisualTaskListExtension : IMarkdownExtension {
9 | public void Setup (MarkdownPipelineBuilder pipeline) {
10 | if (!pipeline.InlineParsers.Contains()) {
11 | // Insert the parser after the code span parser
12 | pipeline.InlineParsers.InsertBefore(new TaskListInlineParser());
13 | }
14 | }
15 |
16 | public void Setup (MarkdownPipeline pipeline, IMarkdownRenderer renderer) {
17 | if (renderer is HtmlRenderer htmlRenderer) {
18 | htmlRenderer.ObjectRenderers.AddIfNotAlready();
19 | }
20 |
21 | if (renderer is NormalizeRenderer normalizeRenderer) {
22 | normalizeRenderer.ObjectRenderers.AddIfNotAlready();
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Cli/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using Markdig;
8 |
9 | namespace Cli {
10 | class Program {
11 | private static readonly MarkdownPipeline markdownPipeline = new MarkdownPipelineBuilder()
12 | .UseBootstrap()
13 | .UseAbbreviations()
14 | .UseAutoIdentifiers()
15 | .UseCitations()
16 | .UseCustomContainers()
17 | .UseDefinitionLists()
18 | .UseEmphasisExtras()
19 | .UseFigures()
20 | .UseFooters()
21 | .UseFootnotes()
22 | .UseGridTables()
23 | .UseMathematics()
24 | .UseMediaLinks()
25 | .UsePipeTables()
26 | .UseListExtras()
27 | .Use()
28 | .UseDiagrams()
29 | .UseAutoLinks()
30 | .UseGenericAttributes()
31 | .UseSoftlineBreakAsHardlineBreak()
32 | .Build();
33 |
34 | public static void Main (String[] args) {
35 | var markdown = File.ReadAllText(args[0], Encoding.UTF8);
36 | var htmlBody = Markdown.ToHtml(markdown, markdownPipeline);
37 |
38 | Console.OutputEncoding = Encoding.UTF8;
39 | Console.WriteLine(
40 | $@"
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | {htmlBody}
51 |
52 | "
53 | );
54 | }
55 |
56 | private static String _getCSS () => File.ReadAllText(
57 | AppDomain.CurrentDomain.BaseDirectory + "../../../style/md.css",
58 | Encoding.UTF8
59 | );
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Cli/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("MarkCLI")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("MarkCLI")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("2925eb4c-fd10-493f-9261-03c155b851ee")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Savas Ziplies
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/MarkdownViewerPlusPlus.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MarkdownViewerPlusPlus", "MarkdownViewerPlusPlus\MarkdownViewerPlusPlus.csproj", "{E56F6E12-089C-40ED-BCFD-923E5FA121A1}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cli", "Cli\Cli.csproj", "{2925EB4C-FD10-493F-9261-03C155B851EE}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Debug|x64 = Debug|x64
14 | Debug|x86 = Debug|x86
15 | Release|Any CPU = Release|Any CPU
16 | Release|x64 = Release|x64
17 | Release|x86 = Release|x86
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {E56F6E12-089C-40ED-BCFD-923E5FA121A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {E56F6E12-089C-40ED-BCFD-923E5FA121A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {E56F6E12-089C-40ED-BCFD-923E5FA121A1}.Debug|x64.ActiveCfg = Debug|x64
23 | {E56F6E12-089C-40ED-BCFD-923E5FA121A1}.Debug|x64.Build.0 = Debug|x64
24 | {E56F6E12-089C-40ED-BCFD-923E5FA121A1}.Debug|x86.ActiveCfg = Debug|x86
25 | {E56F6E12-089C-40ED-BCFD-923E5FA121A1}.Debug|x86.Build.0 = Debug|x86
26 | {E56F6E12-089C-40ED-BCFD-923E5FA121A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {E56F6E12-089C-40ED-BCFD-923E5FA121A1}.Release|Any CPU.Build.0 = Release|Any CPU
28 | {E56F6E12-089C-40ED-BCFD-923E5FA121A1}.Release|x64.ActiveCfg = Release|x64
29 | {E56F6E12-089C-40ED-BCFD-923E5FA121A1}.Release|x64.Build.0 = Release|x64
30 | {E56F6E12-089C-40ED-BCFD-923E5FA121A1}.Release|x86.ActiveCfg = Release|x86
31 | {E56F6E12-089C-40ED-BCFD-923E5FA121A1}.Release|x86.Build.0 = Release|x86
32 | {2925EB4C-FD10-493F-9261-03C155B851EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {2925EB4C-FD10-493F-9261-03C155B851EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {2925EB4C-FD10-493F-9261-03C155B851EE}.Debug|x64.ActiveCfg = Debug|Any CPU
35 | {2925EB4C-FD10-493F-9261-03C155B851EE}.Debug|x64.Build.0 = Debug|Any CPU
36 | {2925EB4C-FD10-493F-9261-03C155B851EE}.Debug|x86.ActiveCfg = Debug|Any CPU
37 | {2925EB4C-FD10-493F-9261-03C155B851EE}.Debug|x86.Build.0 = Debug|Any CPU
38 | {2925EB4C-FD10-493F-9261-03C155B851EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
39 | {2925EB4C-FD10-493F-9261-03C155B851EE}.Release|Any CPU.Build.0 = Release|Any CPU
40 | {2925EB4C-FD10-493F-9261-03C155B851EE}.Release|x64.ActiveCfg = Release|Any CPU
41 | {2925EB4C-FD10-493F-9261-03C155B851EE}.Release|x64.Build.0 = Release|Any CPU
42 | {2925EB4C-FD10-493F-9261-03C155B851EE}.Release|x86.ActiveCfg = Release|Any CPU
43 | {2925EB4C-FD10-493F-9261-03C155B851EE}.Release|x86.Build.0 = Release|Any CPU
44 | EndGlobalSection
45 | GlobalSection(SolutionProperties) = preSolution
46 | HideSolutionNode = FALSE
47 | EndGlobalSection
48 | GlobalSection(ExtensibilityGlobals) = postSolution
49 | SolutionGuid = {5AAE5D73-CE10-405F-B6A7-585D546B1184}
50 | EndGlobalSection
51 | EndGlobal
52 |
--------------------------------------------------------------------------------
/MarkdownViewerPlusPlus/DebounceDispatcher.cs:
--------------------------------------------------------------------------------
1 | #region License
2 | /*
3 | **************************************************************
4 | * Author: Rick Strahl
5 | * � West Wind Technologies, 2017
6 | * http://www.west-wind.com/
7 | *
8 | * Created: 07/3/2017
9 | *
10 | * The above copyright notice and this permission notice shall be
11 | * included in all copies or substantial portions of the Software.
12 | *
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 | * OTHER DEALINGS IN THE SOFTWARE.
21 | **************************************************************
22 | */
23 | #endregion
24 |
25 | /*
26 | * Source:
27 | * https://github.com/RickStrahl/MarkdownMonster/blob/master/MarkdownMonster/_Classes/Utilities/DebounceDispatcher.cs
28 | */
29 |
30 | using System;
31 | using System.Windows.Threading;
32 |
33 | namespace MarkdownMonster.Windows {
34 | ///
35 | /// Provides Debounce() and Throttle() methods.
36 | /// Use these methods to ensure that events aren't handled too frequently.
37 | ///
38 | /// Throttle() ensures that events are throttled by the interval specified.
39 | /// Only the last event in the interval sequence of events fires.
40 | ///
41 | /// Debounce() fires an event only after the specified interval has passed
42 | /// in which no other pending event has fired. Only the last event in the
43 | /// sequence is fired.
44 | ///
45 | /// More info:
46 | /// https://weblog.west-wind.com/posts/2017/Jul/02/Debouncing-and-Throttling-Dispatcher-Events
47 | ///
48 | public class DebounceDispatcher {
49 | private DispatcherTimer timer;
50 | private DateTime timerStarted { get; set; } = DateTime.UtcNow.AddYears(-1);
51 |
52 | ///
53 | /// Debounce an event by resetting the event timeout every time the event is
54 | /// fired. The behavior is that the Action passed is fired only after events
55 | /// stop firing for the given timeout period.
56 | ///
57 | /// Use Debounce when you want events to fire only after events stop firing
58 | /// after the given interval timeout period.
59 | ///
60 | /// Wrap the logic you would normally use in your event code into
61 | /// the Action you pass to this method to debounce the event.
62 | ///
63 | /// Timeout in Milliseconds
64 | /// Action
65 | /// optional parameter
66 | /// optional priorty for the dispatcher
67 | /// optional dispatcher. If not passed or null CurrentDispatcher is used.
68 | public void Debounce (int interval, Action