├── .gitattributes ├── .gitignore ├── BlogsAPI ├── BlogInfo.cs ├── BlogsAPI.csproj ├── CategoryInfo.cs ├── Enclosure.cs ├── FileData.cs ├── MetaTools.cs ├── Post.cs ├── Properties │ └── AssemblyInfo.cs ├── Source.cs └── UrlData.cs ├── DLL ├── Common.Logging.dll ├── CommonMark.dll ├── ControlzEx.dll ├── CookComputing.XmlRpcV2.dll ├── Fluent.dll ├── HtmlAgilityPack.dll ├── ICSharpCode.AvalonEdit.dll ├── Pechkin.Synchronized.dll ├── Pechkin.dll ├── System.Windows.Interactivity.dll ├── libeay32.dll ├── libgcc_s_dw2-1.dll ├── mingwm10.dll ├── ssleay32.dll └── wkhtmltox0.dll ├── MarkWord.sln ├── MarkWord ├── App.xaml ├── App.xaml.cs ├── AutoCompletion.cs ├── AutoItem.cs ├── BLL │ ├── BlogsHelper.cs │ ├── FileManager.cs │ └── HtmlHelper.cs ├── HTMLPage1.html ├── Images │ ├── BlueTheme.png │ ├── Bold.png │ ├── Copy.png │ ├── Cut.png │ ├── FormatPainter.png │ ├── GalleryLarge.png │ ├── Image.png │ ├── Italic.png │ ├── LineNumbers.png │ ├── PasteFormating.png │ ├── PasteImage.png │ ├── PasteLarge.png │ ├── PasteSourceFormating.png │ ├── PasteText.png │ ├── PasteTextOnly.png │ ├── Save.png │ ├── ShrinkFont.png │ ├── SilverTheme.png │ ├── Strikethrough.png │ ├── Subscript.png │ ├── Superscript.png │ ├── T_Comment_Sm_N.png │ ├── T_SelectParent_Sm_N.png │ ├── T_WrapTag_Sm_N.png │ ├── TextHighlightColor.png │ ├── Underline.png │ ├── addons32.png │ ├── bold16.png │ ├── book_open.png │ ├── borderbottom16.png │ ├── both.png │ ├── casing16.png │ ├── clock1_16.png │ ├── clock_16.png │ ├── close32.png │ ├── color_line.png │ ├── copy16.png │ ├── copyformat16.png │ ├── currLine.png │ ├── cut16.png │ ├── draft_versions.png │ ├── entire_network.png │ ├── eraseformat16.png │ ├── exit16.png │ ├── fileloadIcon.png │ ├── filetype_html.png │ ├── filetype_pdf.png │ ├── fill16.png │ ├── find32.png │ ├── find_16.png │ ├── fontcolor16.png │ ├── fontsizedecrease16.png │ ├── fontsizeincrease16.png │ ├── full.png │ ├── goto16.png │ ├── hilight16.png │ ├── icon.ico │ ├── icon.png │ ├── indentdecrease16.png │ ├── indentdecrease161.png │ ├── indentincrease16.png │ ├── invisiblechars16.png │ ├── italic16.png │ ├── key_enter.png │ ├── key_spaces.png │ ├── key_tabs.png │ ├── link_16x16.png │ ├── loadImg.png │ ├── loadImg.psd │ ├── markInfo.png │ ├── multilevellist16.png │ ├── new.png │ ├── newdocument32.png │ ├── oficina_MD.png │ ├── oficina_html.png │ ├── oficina_pdf.png │ ├── ok.png │ ├── open16.png │ ├── open32.png │ ├── options16.png │ ├── orderedlist16.png │ ├── pageblank16.png │ ├── paragraphspacing16.png │ ├── paste16.png │ ├── paste32.png │ ├── paste321.png │ ├── pastelink16.png │ ├── pastespecial16.png │ ├── pencil_32.png │ ├── prepare32.png │ ├── presentation.png │ ├── print32.png │ ├── print321.png │ ├── printpreview32.png │ ├── printquick16.png │ ├── printquick32.png │ ├── publish32.png │ ├── redo16.png │ ├── replace16.png │ ├── save16.png │ ├── save32.png │ ├── saveas32.png │ ├── saveas321.png │ ├── select16.png │ ├── send32.png │ ├── sort16.png │ ├── strikethru16.png │ ├── style16.png │ ├── style_add.png │ ├── style_edit.png │ ├── stylechange32.png │ ├── styleset16.png │ ├── subindex16.png │ ├── superindex16.png │ ├── symbol_check.png │ ├── tableCellPadding.gif │ ├── textBottom.png │ ├── textTop.png │ ├── text_signature.png │ ├── textaligncenter16.png │ ├── textalignjustify16.png │ ├── textalignleft16.png │ ├── textalignright16.png │ ├── themefont.png │ ├── title.png │ ├── title1.png │ ├── title2.png │ ├── title3.png │ ├── title4.png │ ├── title5.png │ ├── title6.png │ ├── underline16.png │ ├── undo16.png │ ├── unorderedlist16.png │ ├── upload.png │ ├── user_male_16.png │ ├── word2003doc32.png │ ├── worddocument32.png │ └── wordtemplate32.png ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── MarkEditer.xaml ├── MarkEditer.xaml.cs ├── MarkWord.csproj ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── DefaultStyle.css │ └── test.txt ├── Template │ └── TemplateStyle.xaml ├── Utils │ ├── Annotations.cs │ ├── BlogsDocumentInfo.cs │ ├── BlogsInfo.cs │ ├── Common.cs │ ├── Config.cs │ ├── DisplayHandler.cs │ ├── PublishInfoHandler.cs │ ├── ThemeStyle.cs │ ├── Tools.cs │ └── WorkType.cs ├── ViewModels │ ├── ColorViewModel.cs │ ├── FontsViewModel.cs │ └── ViewModel.cs ├── WebDoc.xaml ├── WebDoc.xaml.cs ├── WinAddSnippet.xaml ├── WinAddSnippet.xaml.cs ├── WinBlogsLogin.xaml ├── WinBlogsLogin.xaml.cs ├── WinDeepin.xaml ├── WinDeepin.xaml.cs ├── WinFindReplaceDialog.xaml ├── WinFindReplaceDialog.xaml.cs ├── WinHelp.xaml ├── WinHelp.xaml.cs ├── WinSignature.xaml ├── WinSignature.xaml.cs ├── WinStyleSelected.xaml ├── WinStyleSelected.xaml.cs ├── WinTableConvert.xaml ├── WinTableConvert.xaml.cs ├── WinUploadProcess.xaml ├── WinUploadProcess.xaml.cs ├── bin │ ├── Debug │ │ ├── Config │ │ │ ├── imges │ │ │ │ └── imagefile.jpg │ │ │ └── markword.html │ │ └── Source │ │ │ └── style │ │ │ ├── DefaultStyle.css │ │ │ └── Style1.css │ └── Release │ │ ├── Config │ │ ├── imges │ │ │ └── imagefile.jpg │ │ └── markword.html │ │ └── Source │ │ └── style │ │ ├── DefaultStyle.css │ │ └── Style1.css └── icon.ico ├── README.md └── api配置.txt /.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 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | [Xx]64/ 19 | [Xx]86/ 20 | [Bb]uild/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | 85 | # Visual Studio profiler 86 | *.psess 87 | *.vsp 88 | *.vspx 89 | *.sap 90 | 91 | # TFS 2012 Local Workspace 92 | $tf/ 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | *.DotSettings.user 101 | 102 | # JustCode is a .NET coding add-in 103 | .JustCode 104 | 105 | # TeamCity is a build add-in 106 | _TeamCity* 107 | 108 | # DotCover is a Code Coverage Tool 109 | *.dotCover 110 | 111 | # NCrunch 112 | _NCrunch_* 113 | .*crunch*.local.xml 114 | nCrunchTemp_* 115 | 116 | # MightyMoose 117 | *.mm.* 118 | AutoTest.Net/ 119 | 120 | # Web workbench (sass) 121 | .sass-cache/ 122 | 123 | # Installshield output folder 124 | [Ee]xpress/ 125 | 126 | # DocProject is a documentation generator add-in 127 | DocProject/buildhelp/ 128 | DocProject/Help/*.HxT 129 | DocProject/Help/*.HxC 130 | DocProject/Help/*.hhc 131 | DocProject/Help/*.hhk 132 | DocProject/Help/*.hhp 133 | DocProject/Help/Html2 134 | DocProject/Help/html 135 | 136 | # Click-Once directory 137 | publish/ 138 | 139 | # Publish Web Output 140 | *.[Pp]ublish.xml 141 | *.azurePubxml 142 | 143 | # TODO: Un-comment the next line if you do not want to checkin 144 | # your web deploy settings because they may include unencrypted 145 | # passwords 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # NuGet Packages 150 | *.nupkg 151 | # The packages folder can be ignored because of Package Restore 152 | **/packages/* 153 | # except build/, which is used as an MSBuild target. 154 | !**/packages/build/ 155 | # Uncomment if necessary however generally it will be regenerated when needed 156 | #!**/packages/repositories.config 157 | # NuGet v3's project.json files produces more ignoreable files 158 | *.nuget.props 159 | *.nuget.targets 160 | 161 | # Microsoft Azure Build Output 162 | csx/ 163 | *.build.csdef 164 | 165 | # Microsoft Azure Emulator 166 | ecf/ 167 | rcf/ 168 | 169 | # Microsoft Azure ApplicationInsights config file 170 | ApplicationInsights.config 171 | 172 | # Windows Store app package directory 173 | AppPackages/ 174 | BundleArtifacts/ 175 | 176 | # Visual Studio cache files 177 | # files ending in .cache can be ignored 178 | *.[Cc]ache 179 | # but keep track of directories ending in .cache 180 | !*.[Cc]ache/ 181 | 182 | # Others 183 | ClientBin/ 184 | [Ss]tyle[Cc]op.* 185 | ~$* 186 | *~ 187 | *.dbmdl 188 | *.dbproj.schemaview 189 | *.pfx 190 | *.publishsettings 191 | node_modules/ 192 | orleans.codegen.cs 193 | 194 | # RIA/Silverlight projects 195 | Generated_Code/ 196 | 197 | # Backup & report files from converting an old project file 198 | # to a newer Visual Studio version. Backup files are not needed, 199 | # because we have git ;-) 200 | _UpgradeReport_Files/ 201 | Backup*/ 202 | UpgradeLog*.XML 203 | UpgradeLog*.htm 204 | 205 | # SQL Server files 206 | *.mdf 207 | *.ldf 208 | 209 | # Business Intelligence projects 210 | *.rdl.data 211 | *.bim.layout 212 | *.bim_*.settings 213 | 214 | # Microsoft Fakes 215 | FakesAssemblies/ 216 | 217 | # GhostDoc plugin setting file 218 | *.GhostDoc.xml 219 | 220 | # Node.js Tools for Visual Studio 221 | .ntvs_analysis.dat 222 | 223 | # Visual Studio 6 build log 224 | *.plg 225 | 226 | # Visual Studio 6 workspace options file 227 | *.opt 228 | 229 | # Visual Studio LightSwitch build output 230 | **/*.HTMLClient/GeneratedArtifacts 231 | **/*.DesktopClient/GeneratedArtifacts 232 | **/*.DesktopClient/ModelManifest.xml 233 | **/*.Server/GeneratedArtifacts 234 | **/*.Server/ModelManifest.xml 235 | _Pvt_Extensions 236 | 237 | # LightSwitch generated files 238 | GeneratedArtifacts/ 239 | ModelManifest.xml 240 | 241 | # Paket dependency manager 242 | .paket/paket.exe 243 | 244 | # FAKE - F# Make 245 | .fake/ -------------------------------------------------------------------------------- /BlogsAPI/BlogInfo.cs: -------------------------------------------------------------------------------- 1 | using CookComputing.XmlRpc; 2 | 3 | namespace BlogsAPI 4 | { 5 | [XmlRpcMissingMapping(MappingAction.Ignore)] 6 | public struct BlogInfo 7 | { 8 | public string blogid; 9 | public string url; 10 | public string blogName; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /BlogsAPI/BlogsAPI.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {9AB23167-97AE-4FED-9698-597F14124E54} 8 | Library 9 | Properties 10 | BlogsAPI 11 | BlogsAPI 12 | v4.0 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | False 35 | ..\DLL\CookComputing.XmlRpcV2.dll 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Component 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 66 | -------------------------------------------------------------------------------- /BlogsAPI/CategoryInfo.cs: -------------------------------------------------------------------------------- 1 | using CookComputing.XmlRpc; 2 | 3 | namespace BlogsAPI 4 | { 5 | [XmlRpcMissingMapping(MappingAction.Ignore)] 6 | public struct CategoryInfo 7 | { 8 | public string description; 9 | public string htmlUrl; 10 | public string rssUrl; 11 | public string title; 12 | public string categoryid; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /BlogsAPI/Enclosure.cs: -------------------------------------------------------------------------------- 1 | using CookComputing.XmlRpc; 2 | 3 | namespace BlogsAPI 4 | { 5 | [XmlRpcMissingMapping(MappingAction.Ignore)] 6 | public struct Enclosure 7 | { 8 | public int length; 9 | public string type; 10 | public string url; 11 | } 12 | } -------------------------------------------------------------------------------- /BlogsAPI/FileData.cs: -------------------------------------------------------------------------------- 1 | using CookComputing.XmlRpc; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace BlogsAPI 8 | { 9 | [XmlRpcMissingMapping(CookComputing.XmlRpc.MappingAction.Ignore)] 10 | public struct FileData 11 | { 12 | public byte[] bits; 13 | public string name; 14 | public string type; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /BlogsAPI/MetaTools.cs: -------------------------------------------------------------------------------- 1 | using CookComputing.XmlRpc; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace BlogsAPI 8 | { 9 | /// 10 | /// API 11 | /// 来自博客园 12 | /// 13 | public class MetaTools : XmlRpcClientProtocol 14 | { 15 | 16 | 17 | /// 18 | /// 删除文章 19 | /// 20 | /// 可以不用填写 21 | /// 22 | /// 23 | /// 24 | /// publish - Where applicable, this specifies whether the blog should be republished after the post has been deleted. 25 | /// 26 | [XmlRpcMethod("blogger.deletePost")] 27 | public bool deletePost(string appKey, string postid, string username, string password, bool publish) 28 | { 29 | return (bool)this.Invoke("deletePost", new object[] { appKey, postid, username, password, publish }); 30 | } 31 | 32 | 33 | /// 34 | /// 获取博客账户信息 35 | /// 36 | /// This value is ignored. 37 | /// The ID of the post to update. 38 | /// The name of the user’s space. 39 | /// 40 | /// An array of structs that represents each of the user’s blogs. The array will contain a maximum of one struct, since a user can only have a single space with a single blog. 41 | /// TODO:得到用户的博客清单 42 | [XmlRpcMethod("blogger.getUsersBlogs")] 43 | public BlogInfo[] getUsersBlogs(string appKey, string username, string password) 44 | { 45 | return (BlogInfo[])this.Invoke("getUsersBlogs", new object[] { appKey, username, password }); 46 | } 47 | 48 | 49 | /// 50 | /// 获取文章分类 51 | /// 52 | /// This should be the string MyBlog, which indicates that the post is being created in the user’s blog. 53 | /// The name of the user’s space. 54 | /// The user’s secret word. 55 | /// An array of structs that contains one struct for each category. Each category struct will contain a description field that contains the name of the category. 56 | /// TODO:得到博客分类 57 | [XmlRpcMethod("metaWeblog.getCategories")] 58 | public CategoryInfo[] getCategories(string blogid, string username, string password) 59 | { 60 | return (CategoryInfo[])this.Invoke("getCategories", new object[] { blogid, username, password }); 61 | } 62 | 63 | 64 | 65 | /// 66 | /// 获取一个博客文章 67 | /// 68 | /// The ID of the post to update. 69 | /// The name of the user’s space. 70 | /// The user’s secret word. 71 | /// Always returns true. 72 | /// TODO:获取一个帖子 73 | [XmlRpcMethod("metaWeblog.getPost")] 74 | public Post getPost(string postid, string username, string password) 75 | { 76 | return (Post)this.Invoke("getPost", new object[] { postid, username, password }); 77 | } 78 | 79 | 80 | 81 | 82 | /// 83 | /// 获取最新的文章 84 | /// 85 | /// 博客编号 86 | /// 用户名 87 | /// 密码 88 | /// 获取数量 89 | /// 90 | [XmlRpcMethod("metaWeblog.getRecentPosts")] 91 | public Post[] getRecentPosts(string blogid, string username, string password, int numberOfPosts) 92 | { 93 | return (Post[])this.Invoke("getRecentPosts", new object[] { blogid, username, password, numberOfPosts }); 94 | } 95 | 96 | 97 | 98 | /// 99 | /// 上传新媒体对象,如图片等 100 | /// 101 | /// 博客编号 102 | /// 用户名 103 | /// 密码 104 | /// 获取数量 105 | /// 106 | [XmlRpcMethod("metaWeblog.newMediaObject")] 107 | public UrlData newMediaObject(string blogid, string username, string password, FileData file) 108 | { 109 | return (UrlData)this.Invoke("newMediaObject", new object[] { blogid, username, password, file }); 110 | } 111 | 112 | 113 | 114 | /// 115 | /// 增加新文章 116 | /// 117 | /// This should be the string MyBlog, which indicates that the post is being created in the user’s blog. 118 | /// The name of the user’s space. 119 | /// The user’s secret word. 120 | /// A struct representing the content to update. 121 | /// If false, this is a draft post. 122 | /// The postid of the newly-created post. 123 | /// TODO:增加一个最新的帖子 124 | [XmlRpcMethod("metaWeblog.newPost")] 125 | public string newPost(string blogid, string username, string password, Post content, bool publish) 126 | { 127 | return (string)this.Invoke("newPost", new object[] { blogid, username, password, content, publish }); 128 | } 129 | 130 | /// 131 | /// 编辑已经存在的文章 132 | /// 133 | /// The ID of the post to update. 134 | /// The name of the user’s space. 135 | /// The user’s secret word. 136 | /// A struct representing the content to update. 137 | /// If false, this is a draft post. 138 | /// Always returns true. 139 | /// TODO:更新一个帖子 140 | [XmlRpcMethod("metaWeblog.editPost")] 141 | public bool editPost( 142 | string postid, 143 | string username, 144 | string password, 145 | Post content, 146 | bool publish) 147 | { 148 | try 149 | { 150 | return (bool)this.Invoke("editPost", new object[] { postid, username, password, content, publish }); 151 | } 152 | catch (CookComputing.XmlRpc.XmlRpcInvalidXmlRpcException ex) 153 | { 154 | if (ex.Message == "response contains invalid boolean value [response : boolean]")//csdn返回值异常,在这边简单处理一下 155 | { 156 | return true; 157 | } 158 | else 159 | { 160 | throw ex; 161 | } 162 | } 163 | } 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /BlogsAPI/Post.cs: -------------------------------------------------------------------------------- 1 | using CookComputing.XmlRpc; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace BlogsAPI 8 | { 9 | [XmlRpcMissingMapping(MappingAction.Ignore)] 10 | public struct Post 11 | { 12 | //必填 13 | public DateTime dateCreated; 14 | public string description; 15 | public string title; 16 | //可选 17 | public string[] categories; 18 | public Enclosure enclosure; 19 | public string link; 20 | public string permalink; 21 | public string postid; 22 | public Source source; 23 | public string userid; 24 | public string mt_allow_comments; 25 | public string mt_allow_pings; 26 | public string mt_convert_breaks; 27 | public string mt_text_more; 28 | public string mt_excerpt; 29 | public string mt_keywords; 30 | public string wp_slug; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /BlogsAPI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("BlogsAPI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("BlogsAPI")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("9ab23167-97ae-4fed-9698-597f14124e54")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /BlogsAPI/Source.cs: -------------------------------------------------------------------------------- 1 | using CookComputing.XmlRpc; 2 | 3 | namespace BlogsAPI 4 | { 5 | [XmlRpcMissingMapping(MappingAction.Ignore)] 6 | public class Source 7 | { 8 | public string name; 9 | public string url; 10 | } 11 | } -------------------------------------------------------------------------------- /BlogsAPI/UrlData.cs: -------------------------------------------------------------------------------- 1 | using CookComputing.XmlRpc; 2 | 3 | namespace BlogsAPI 4 | { 5 | [XmlRpcMissingMapping(MappingAction.Ignore)] 6 | public struct UrlData 7 | { 8 | public string url; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DLL/Common.Logging.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/Common.Logging.dll -------------------------------------------------------------------------------- /DLL/CommonMark.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/CommonMark.dll -------------------------------------------------------------------------------- /DLL/ControlzEx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/ControlzEx.dll -------------------------------------------------------------------------------- /DLL/CookComputing.XmlRpcV2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/CookComputing.XmlRpcV2.dll -------------------------------------------------------------------------------- /DLL/Fluent.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/Fluent.dll -------------------------------------------------------------------------------- /DLL/HtmlAgilityPack.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/HtmlAgilityPack.dll -------------------------------------------------------------------------------- /DLL/ICSharpCode.AvalonEdit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/ICSharpCode.AvalonEdit.dll -------------------------------------------------------------------------------- /DLL/Pechkin.Synchronized.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/Pechkin.Synchronized.dll -------------------------------------------------------------------------------- /DLL/Pechkin.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/Pechkin.dll -------------------------------------------------------------------------------- /DLL/System.Windows.Interactivity.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/System.Windows.Interactivity.dll -------------------------------------------------------------------------------- /DLL/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/libeay32.dll -------------------------------------------------------------------------------- /DLL/libgcc_s_dw2-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/libgcc_s_dw2-1.dll -------------------------------------------------------------------------------- /DLL/mingwm10.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/mingwm10.dll -------------------------------------------------------------------------------- /DLL/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/ssleay32.dll -------------------------------------------------------------------------------- /DLL/wkhtmltox0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/DLL/wkhtmltox0.dll -------------------------------------------------------------------------------- /MarkWord.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25123.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MarkWord", "MarkWord\MarkWord.csproj", "{EF4D991E-EF66-4D63-AD77-4AC88372FB60}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlogsAPI", "BlogsAPI\BlogsAPI.csproj", "{9AB23167-97AE-4FED-9698-597F14124E54}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {EF4D991E-EF66-4D63-AD77-4AC88372FB60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {EF4D991E-EF66-4D63-AD77-4AC88372FB60}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {EF4D991E-EF66-4D63-AD77-4AC88372FB60}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {EF4D991E-EF66-4D63-AD77-4AC88372FB60}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {9AB23167-97AE-4FED-9698-597F14124E54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {9AB23167-97AE-4FED-9698-597F14124E54}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {9AB23167-97AE-4FED-9698-597F14124E54}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {9AB23167-97AE-4FED-9698-597F14124E54}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /MarkWord/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MarkWord/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Windows; 7 | namespace MarkWord 8 | { 9 | /// 10 | /// App.xaml 的交互逻辑 11 | /// 12 | public partial class App : Application 13 | { 14 | protected override void OnStartup(StartupEventArgs e) 15 | { 16 | 17 | SplashScreen s = new SplashScreen("Images/loadImg.png"); 18 | s.Show(true, true); 19 | 20 | BLL.FileManager.CheckMyDocFolder();//检查文件夹 21 | Config.ReadConfig(); 22 | Config.ReadBlogsConfig(); 23 | 24 | base.OnStartup(e); 25 | 26 | 27 | } 28 | protected override void OnExit(ExitEventArgs e) 29 | { 30 | base.OnExit(e); 31 | Config.SaveConfig(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /MarkWord/AutoCompletion.cs: -------------------------------------------------------------------------------- 1 | using ICSharpCode.AvalonEdit.CodeCompletion; 2 | using ICSharpCode.AvalonEdit.Document; 3 | using ICSharpCode.AvalonEdit.Editing; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Media.Imaging; 9 | 10 | namespace MarkWord 11 | { 12 | public class AutoCompletion : ICompletionData 13 | { 14 | public AutoCompletion(string text, string value, string desc) 15 | { 16 | this.Text = text; 17 | this.Value = value; 18 | this.Description = desc; 19 | } 20 | 21 | public System.Windows.Media.ImageSource Image 22 | { 23 | get 24 | { 25 | return new BitmapImage(new Uri("pack://application:,,,/MarkWord;Component/Images/T_SelectParent_Sm_N.png", UriKind.Absolute)); 26 | } 27 | } 28 | 29 | /// 30 | /// 显示的内容 31 | /// 32 | public string Text { get; private set; } 33 | 34 | public string Value { get; private set; } 35 | 36 | 37 | // Use this property if you want to show a fancy UIElement in the drop down list. 38 | public object Content 39 | { 40 | get { return this.Text; } 41 | } 42 | 43 | public object Description 44 | { 45 | get; private set; 46 | } 47 | 48 | public double Priority { get { return 0; } } 49 | 50 | public void Complete(TextArea textArea, ISegment completionSegment, EventArgs insertionRequestEventArgs) 51 | { 52 | 53 | //处理鼠标位置 54 | // string pos = "{$pos}"; // 55 | var tagValue = ReplaceFlag(this.Value);//先处理其他内容 56 | //int offset = tagValue.IndexOf(pos); //+ completionSegment.Offset; 57 | //tagValue = tagValue.Replace(pos, ""); 58 | 59 | textArea.Document.Remove(completionSegment.Offset - 1, 1);//移除输入的字符 60 | textArea.Document.Replace(completionSegment, tagValue);//插入信息 61 | //textArea.Document.Replace(offset, 1, "x",OffsetChangeMappingType.CharacterReplace);//插入信息 62 | 63 | } 64 | /// 65 | /// 处理代替指标 66 | /// 67 | /// 68 | /// 69 | private string ReplaceFlag(string value) 70 | { 71 | //处理鼠标位置 72 | string pos = "{$pos}"; 73 | value = value.Replace(pos, ""); 74 | 75 | //替换为时间 76 | string time = "{$time}"; 77 | value = value.Replace(time, DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")); 78 | 79 | //替换为时间 80 | string date = "{$date}"; 81 | value = value.Replace(date, DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd")); 82 | 83 | return value; 84 | 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /MarkWord/AutoItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace MarkWord 7 | { 8 | public class AutoItem 9 | { 10 | public string Name { set; get; } 11 | public string Value { get; set; } 12 | public string Descript { set; get; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /MarkWord/BLL/BlogsHelper.cs: -------------------------------------------------------------------------------- 1 | using BlogsAPI; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using HtmlAgilityPack; 7 | using System.Net; 8 | using System.IO; 9 | 10 | namespace MarkWord.BLL 11 | { 12 | public class BlogsHelper 13 | { 14 | /// 15 | /// 博客传输控制工具 16 | /// 17 | static MetaTools metaTools = new MetaTools(); 18 | 19 | /// 20 | /// 日志句柄 21 | /// 22 | public static PublishInfoHandler publishHander; 23 | 24 | /// 25 | /// 文档上传,包括新增与更新 26 | /// 27 | public static string UploadBlogs(string apiUrl, string BlogId, string userId, string password, string BlogsModel, string postId, string title, string Markdown, bool publish) 28 | { 29 | 30 | int procIndex = 1; 31 | 32 | SendMsg(5, procIndex, "准备数据中……"); 33 | //转换为html 34 | string Blogs = string.Format("\r\n{0}", CommonMark.CommonMarkConverter.Convert(Markdown)); 35 | metaTools.Url = apiUrl; 36 | 37 | 38 | Post blogsPost = new Post(); 39 | 40 | //分类 41 | List tmpCategories = new List(); 42 | tmpCategories.Add("");//添加空分类,是因为部分博客(如csdn)字段这部分为必填字段不添加会产生异常 43 | blogsPost.categories = tmpCategories.ToArray(); 44 | 45 | //添加时间 46 | blogsPost.dateCreated = DateTime.Now.ToLocalTime(); 47 | 48 | //添加标题 49 | blogsPost.title = title; 50 | 51 | 52 | //指定文章编号 53 | blogsPost.postid = postId; 54 | 55 | //内容 56 | blogsPost.description = BlogsModel.Contains("{0}") ?//必须使用{0}占位符 57 | string.Format(BlogsModel, Blogs) : //根据模板生成数据 主要是为了制定Markdown模板 58 | BlogsModel + Blogs; //通过前缀方式添加 59 | 60 | //开始查找图片并更新到服务器 61 | HtmlDocument htmlDoc = new HtmlDocument(); 62 | WebClient webClient = new WebClient(); 63 | htmlDoc.LoadHtml(blogsPost.description); 64 | var ImgList = htmlDoc.DocumentNode.Descendants("img"); 65 | 66 | int procCount = 3 + ImgList.Count(); 67 | 68 | SendMsg(procCount, procIndex++, string.Format("数据分析完成,总共需要上传{0}张图片", ImgList.Count())); 69 | int imgErr = 0;//图片上传错误数量 70 | foreach (var i in ImgList) 71 | { 72 | SendMsg(procCount, procIndex++, "正在上传图片数据……"); 73 | //获取图片文件字符串 74 | string ImgUrl = i.GetAttributeValue("src", ""); 75 | if (string.IsNullOrEmpty(ImgUrl)) 76 | { 77 | imgErr++; 78 | continue; 79 | } 80 | try 81 | { 82 | var imgeData = webClient.DownloadData(ImgUrl);//下载文件 83 | 84 | FileData fd = default(FileData); 85 | fd.bits = imgeData;//图片数据 86 | fd.name = Path.GetExtension(ImgUrl);//文件名 87 | fd.type = string.Format("image/{0}", fd.name.Substring(1)); 88 | 89 | UrlData obj = metaTools.newMediaObject(BlogId, userId, password, fd); 90 | blogsPost.description = blogsPost.description.Replace(ImgUrl, obj.url); 91 | } 92 | catch 93 | { 94 | imgErr++; 95 | continue; 96 | } 97 | } 98 | try 99 | { 100 | if (string.IsNullOrWhiteSpace(postId)) 101 | { 102 | SendMsg(procCount, procIndex++, "开始发布文章……"); 103 | postId = metaTools.newPost(BlogId, userId, password, blogsPost, publish); 104 | } 105 | else 106 | { 107 | SendMsg(procCount, procIndex++, "正在更新文章……"); 108 | metaTools.editPost(postId, userId, password, blogsPost, publish); 109 | } 110 | } 111 | catch (Exception ex) 112 | { 113 | Common.ShowMessage("博客发送失败"); 114 | return postId; 115 | } 116 | 117 | if (imgErr == 0) 118 | { 119 | Common.ShowMessage("博客发送成功"); 120 | } 121 | else 122 | { 123 | Common.ShowMessage(string.Format("博客发送成功了,但是有{0}张图片发送失败", imgErr)); 124 | } 125 | SendMsg(procCount, procCount, "完成"); 126 | return postId; 127 | 128 | } 129 | 130 | 131 | private static void SendMsg(int maxCount, int Count, string msg) 132 | { 133 | if (publishHander != null) 134 | { 135 | publishHander(maxCount, Count, msg); 136 | } 137 | } 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /MarkWord/BLL/FileManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Microsoft.Win32; 6 | 7 | using System.IO; 8 | 9 | namespace MarkWord.BLL 10 | { 11 | public class FileManager 12 | { 13 | /// 14 | /// 打开Markdown文件 15 | /// 16 | /// 17 | public static string OpenMarkdownFile() 18 | { 19 | OpenFileDialog opFileDialog = new OpenFileDialog(); 20 | opFileDialog.Filter = "Markdown文件|*.md;*.markdown;*.txt|Markdown文件(*.md)|*.md|文本文件(*.txt)|*.txt|其他文件|*.*"; 21 | opFileDialog.FilterIndex = 0; 22 | try 23 | { 24 | if (opFileDialog.ShowDialog() == true) 25 | { 26 | SavePath = opFileDialog.FileName; 27 | if (Config.Common.FileList.Contains(opFileDialog.FileName)) 28 | { 29 | Config.Common.FileList.Remove(opFileDialog.FileName); 30 | Config.Common.FileList.Insert(0, opFileDialog.FileName); 31 | } 32 | else 33 | { 34 | Config.Common.FileList.Insert(0, opFileDialog.FileName); 35 | } 36 | return File.ReadAllText(opFileDialog.FileName, Tools.GetFileType(opFileDialog.FileName)); 37 | } 38 | } 39 | catch (Exception ex) 40 | { 41 | Common.ShowMessage(ex.Message); 42 | return null; 43 | } 44 | return null; 45 | } 46 | 47 | 48 | public static string SavePath { get; set; } 49 | public static bool isChangeFlag { get; set; }//是否更变 50 | public static bool SaveMarkdownFile(string content) 51 | { 52 | SaveFileDialog spFileDialog = new SaveFileDialog(); 53 | spFileDialog.Filter = "Markdown文件(*.md)|*.md|文本文件(*.txt)|*.txt|其他文件|*.*"; 54 | spFileDialog.FilterIndex = 0; 55 | try 56 | { 57 | if (spFileDialog.ShowDialog() == true) 58 | { 59 | File.WriteAllText(spFileDialog.FileName, content, Encoding.UTF8); 60 | SavePath = spFileDialog.FileName; 61 | 62 | if (Config.Common.FileList.Contains(spFileDialog.FileName)) 63 | { 64 | Config.Common.FileList.Remove(spFileDialog.FileName); 65 | Config.Common.FileList.Insert(0, spFileDialog.FileName); 66 | } 67 | else 68 | { 69 | Config.Common.FileList.Insert(0, spFileDialog.FileName); 70 | } 71 | 72 | isChangeFlag = false; 73 | return true; 74 | } 75 | } 76 | catch (Exception ex) 77 | { 78 | Common.ShowMessage(ex.Message); 79 | return false; 80 | } 81 | return false; 82 | } 83 | 84 | public static bool SaveMarkdownFileWithoutDialg(string content) 85 | { 86 | try 87 | { 88 | File.WriteAllText(SavePath, content, Encoding.UTF8); 89 | isChangeFlag = false; 90 | return true; 91 | } 92 | catch (Exception ex) 93 | { 94 | Common.ShowMessage(ex.Message); 95 | return false; 96 | } 97 | return false; 98 | } 99 | 100 | 101 | 102 | public static bool OutputPdf(string htmlDoc) 103 | { 104 | if (!string.IsNullOrEmpty(htmlDoc)) 105 | { 106 | 107 | SaveFileDialog sp = new SaveFileDialog(); 108 | sp.Filter = "PDF文件|*.pdf"; 109 | var result = sp.ShowDialog(); 110 | if (result.HasValue && result.Value) 111 | { 112 | Tools.HtmlToPdf(sp.FileName, htmlDoc, false); 113 | return true; 114 | } 115 | return false; 116 | } 117 | else 118 | { 119 | throw new ArgumentException("无效的参数输入"); 120 | } 121 | return false; 122 | } 123 | 124 | public static bool OutputHTLM(string htmlDoc) 125 | { 126 | if (!string.IsNullOrEmpty(htmlDoc)) 127 | { 128 | 129 | SaveFileDialog sp = new SaveFileDialog(); 130 | sp.Filter = "HTML文件|*.html"; 131 | var result = sp.ShowDialog(); 132 | if (result.HasValue && result.Value) 133 | { 134 | File.WriteAllText(sp.FileName, htmlDoc, Encoding.UTF8); 135 | Common.ShowStatusMessage("导出HTML " + sp.FileName + " 成功"); 136 | return true; 137 | } 138 | return false; 139 | } 140 | else 141 | { 142 | throw new ArgumentException("无效的参数输入"); 143 | } 144 | return false; 145 | } 146 | 147 | 148 | 149 | public static void GetStyleList() 150 | { 151 | Config.StyleList = new Dictionary(); 152 | var files = Directory.GetFiles(Config.StyleDir); 153 | foreach (var f in files) 154 | { 155 | Config.StyleList.Add(Path.GetFileNameWithoutExtension(f), f); 156 | } 157 | } 158 | 159 | public static void LoadStyle(string styleName) 160 | { 161 | var file = Path.Combine(Config.StyleDir, styleName + ".css"); 162 | if (!File.Exists(file)) 163 | { 164 | Config.Common.StyleName = "DefaultStyle"; 165 | Config.Style = Properties.Resources.DefaultStyle; 166 | return; 167 | } 168 | Config.Common.StyleName = styleName; 169 | Config.Style = File.ReadAllText(file, Encoding.UTF8); 170 | } 171 | 172 | 173 | public static void CheckMyDocFolder() 174 | { 175 | if (!Directory.Exists(Config.MyDocumentFolder)) 176 | { 177 | Directory.CreateDirectory(Config.MyDocumentFolder); 178 | } 179 | } 180 | 181 | public static string GetImgFilePath() 182 | { 183 | OpenFileDialog opFileDialog = new OpenFileDialog(); 184 | opFileDialog.Filter = "图片文件|*.jpg;*.bmp;*.png;*.gif"; 185 | try 186 | { 187 | if (opFileDialog.ShowDialog() == true) 188 | { 189 | return opFileDialog.FileName; 190 | } 191 | } 192 | catch (Exception ex) 193 | { 194 | Common.ShowMessage(ex.Message); 195 | return null; 196 | } 197 | return null; 198 | } 199 | } 200 | } 201 | -------------------------------------------------------------------------------- /MarkWord/BLL/HtmlHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace MarkWord.BLL 7 | { 8 | public class HtmlHelper 9 | { 10 | public static string MarkToHTMlPage(string MarkValue) 11 | { 12 | #region 数据初始化 13 | StringBuilder sbr = new StringBuilder(); 14 | sbr.AppendLine(" "); 15 | sbr.AppendLine(""); 24 | sbr.AppendLine(""); 28 | sbr.AppendFormat(@" 29 | {0} 30 | ", CommonMark.CommonMarkConverter.Convert(MarkValue)); 31 | #endregion 32 | 33 | return sbr.ToString(); 34 | 35 | } 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /MarkWord/HTMLPage1.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /MarkWord/Images/BlueTheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/BlueTheme.png -------------------------------------------------------------------------------- /MarkWord/Images/Bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/Bold.png -------------------------------------------------------------------------------- /MarkWord/Images/Copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/Copy.png -------------------------------------------------------------------------------- /MarkWord/Images/Cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/Cut.png -------------------------------------------------------------------------------- /MarkWord/Images/FormatPainter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/FormatPainter.png -------------------------------------------------------------------------------- /MarkWord/Images/GalleryLarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/GalleryLarge.png -------------------------------------------------------------------------------- /MarkWord/Images/Image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/Image.png -------------------------------------------------------------------------------- /MarkWord/Images/Italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/Italic.png -------------------------------------------------------------------------------- /MarkWord/Images/LineNumbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/LineNumbers.png -------------------------------------------------------------------------------- /MarkWord/Images/PasteFormating.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/PasteFormating.png -------------------------------------------------------------------------------- /MarkWord/Images/PasteImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/PasteImage.png -------------------------------------------------------------------------------- /MarkWord/Images/PasteLarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/PasteLarge.png -------------------------------------------------------------------------------- /MarkWord/Images/PasteSourceFormating.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/PasteSourceFormating.png -------------------------------------------------------------------------------- /MarkWord/Images/PasteText.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/PasteText.png -------------------------------------------------------------------------------- /MarkWord/Images/PasteTextOnly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/PasteTextOnly.png -------------------------------------------------------------------------------- /MarkWord/Images/Save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/Save.png -------------------------------------------------------------------------------- /MarkWord/Images/ShrinkFont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/ShrinkFont.png -------------------------------------------------------------------------------- /MarkWord/Images/SilverTheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/SilverTheme.png -------------------------------------------------------------------------------- /MarkWord/Images/Strikethrough.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/Strikethrough.png -------------------------------------------------------------------------------- /MarkWord/Images/Subscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/Subscript.png -------------------------------------------------------------------------------- /MarkWord/Images/Superscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/Superscript.png -------------------------------------------------------------------------------- /MarkWord/Images/T_Comment_Sm_N.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/T_Comment_Sm_N.png -------------------------------------------------------------------------------- /MarkWord/Images/T_SelectParent_Sm_N.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/T_SelectParent_Sm_N.png -------------------------------------------------------------------------------- /MarkWord/Images/T_WrapTag_Sm_N.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/T_WrapTag_Sm_N.png -------------------------------------------------------------------------------- /MarkWord/Images/TextHighlightColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/TextHighlightColor.png -------------------------------------------------------------------------------- /MarkWord/Images/Underline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/Underline.png -------------------------------------------------------------------------------- /MarkWord/Images/addons32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/addons32.png -------------------------------------------------------------------------------- /MarkWord/Images/bold16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/bold16.png -------------------------------------------------------------------------------- /MarkWord/Images/book_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/book_open.png -------------------------------------------------------------------------------- /MarkWord/Images/borderbottom16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/borderbottom16.png -------------------------------------------------------------------------------- /MarkWord/Images/both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/both.png -------------------------------------------------------------------------------- /MarkWord/Images/casing16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/casing16.png -------------------------------------------------------------------------------- /MarkWord/Images/clock1_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/clock1_16.png -------------------------------------------------------------------------------- /MarkWord/Images/clock_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/clock_16.png -------------------------------------------------------------------------------- /MarkWord/Images/close32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/close32.png -------------------------------------------------------------------------------- /MarkWord/Images/color_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/color_line.png -------------------------------------------------------------------------------- /MarkWord/Images/copy16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/copy16.png -------------------------------------------------------------------------------- /MarkWord/Images/copyformat16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/copyformat16.png -------------------------------------------------------------------------------- /MarkWord/Images/currLine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/currLine.png -------------------------------------------------------------------------------- /MarkWord/Images/cut16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/cut16.png -------------------------------------------------------------------------------- /MarkWord/Images/draft_versions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/draft_versions.png -------------------------------------------------------------------------------- /MarkWord/Images/entire_network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/entire_network.png -------------------------------------------------------------------------------- /MarkWord/Images/eraseformat16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/eraseformat16.png -------------------------------------------------------------------------------- /MarkWord/Images/exit16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/exit16.png -------------------------------------------------------------------------------- /MarkWord/Images/fileloadIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/fileloadIcon.png -------------------------------------------------------------------------------- /MarkWord/Images/filetype_html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/filetype_html.png -------------------------------------------------------------------------------- /MarkWord/Images/filetype_pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/filetype_pdf.png -------------------------------------------------------------------------------- /MarkWord/Images/fill16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/fill16.png -------------------------------------------------------------------------------- /MarkWord/Images/find32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/find32.png -------------------------------------------------------------------------------- /MarkWord/Images/find_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/find_16.png -------------------------------------------------------------------------------- /MarkWord/Images/fontcolor16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/fontcolor16.png -------------------------------------------------------------------------------- /MarkWord/Images/fontsizedecrease16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/fontsizedecrease16.png -------------------------------------------------------------------------------- /MarkWord/Images/fontsizeincrease16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/fontsizeincrease16.png -------------------------------------------------------------------------------- /MarkWord/Images/full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/full.png -------------------------------------------------------------------------------- /MarkWord/Images/goto16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/goto16.png -------------------------------------------------------------------------------- /MarkWord/Images/hilight16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/hilight16.png -------------------------------------------------------------------------------- /MarkWord/Images/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/icon.ico -------------------------------------------------------------------------------- /MarkWord/Images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/icon.png -------------------------------------------------------------------------------- /MarkWord/Images/indentdecrease16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/indentdecrease16.png -------------------------------------------------------------------------------- /MarkWord/Images/indentdecrease161.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/indentdecrease161.png -------------------------------------------------------------------------------- /MarkWord/Images/indentincrease16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/indentincrease16.png -------------------------------------------------------------------------------- /MarkWord/Images/invisiblechars16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/invisiblechars16.png -------------------------------------------------------------------------------- /MarkWord/Images/italic16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/italic16.png -------------------------------------------------------------------------------- /MarkWord/Images/key_enter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/key_enter.png -------------------------------------------------------------------------------- /MarkWord/Images/key_spaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/key_spaces.png -------------------------------------------------------------------------------- /MarkWord/Images/key_tabs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/key_tabs.png -------------------------------------------------------------------------------- /MarkWord/Images/link_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/link_16x16.png -------------------------------------------------------------------------------- /MarkWord/Images/loadImg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/loadImg.png -------------------------------------------------------------------------------- /MarkWord/Images/loadImg.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/loadImg.psd -------------------------------------------------------------------------------- /MarkWord/Images/markInfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/markInfo.png -------------------------------------------------------------------------------- /MarkWord/Images/multilevellist16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/multilevellist16.png -------------------------------------------------------------------------------- /MarkWord/Images/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/new.png -------------------------------------------------------------------------------- /MarkWord/Images/newdocument32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/newdocument32.png -------------------------------------------------------------------------------- /MarkWord/Images/oficina_MD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/oficina_MD.png -------------------------------------------------------------------------------- /MarkWord/Images/oficina_html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/oficina_html.png -------------------------------------------------------------------------------- /MarkWord/Images/oficina_pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/oficina_pdf.png -------------------------------------------------------------------------------- /MarkWord/Images/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/ok.png -------------------------------------------------------------------------------- /MarkWord/Images/open16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/open16.png -------------------------------------------------------------------------------- /MarkWord/Images/open32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/open32.png -------------------------------------------------------------------------------- /MarkWord/Images/options16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/options16.png -------------------------------------------------------------------------------- /MarkWord/Images/orderedlist16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/orderedlist16.png -------------------------------------------------------------------------------- /MarkWord/Images/pageblank16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/pageblank16.png -------------------------------------------------------------------------------- /MarkWord/Images/paragraphspacing16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/paragraphspacing16.png -------------------------------------------------------------------------------- /MarkWord/Images/paste16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/paste16.png -------------------------------------------------------------------------------- /MarkWord/Images/paste32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/paste32.png -------------------------------------------------------------------------------- /MarkWord/Images/paste321.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/paste321.png -------------------------------------------------------------------------------- /MarkWord/Images/pastelink16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/pastelink16.png -------------------------------------------------------------------------------- /MarkWord/Images/pastespecial16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/pastespecial16.png -------------------------------------------------------------------------------- /MarkWord/Images/pencil_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/pencil_32.png -------------------------------------------------------------------------------- /MarkWord/Images/prepare32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/prepare32.png -------------------------------------------------------------------------------- /MarkWord/Images/presentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/presentation.png -------------------------------------------------------------------------------- /MarkWord/Images/print32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/print32.png -------------------------------------------------------------------------------- /MarkWord/Images/print321.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/print321.png -------------------------------------------------------------------------------- /MarkWord/Images/printpreview32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/printpreview32.png -------------------------------------------------------------------------------- /MarkWord/Images/printquick16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/printquick16.png -------------------------------------------------------------------------------- /MarkWord/Images/printquick32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/printquick32.png -------------------------------------------------------------------------------- /MarkWord/Images/publish32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/publish32.png -------------------------------------------------------------------------------- /MarkWord/Images/redo16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/redo16.png -------------------------------------------------------------------------------- /MarkWord/Images/replace16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/replace16.png -------------------------------------------------------------------------------- /MarkWord/Images/save16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/save16.png -------------------------------------------------------------------------------- /MarkWord/Images/save32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/save32.png -------------------------------------------------------------------------------- /MarkWord/Images/saveas32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/saveas32.png -------------------------------------------------------------------------------- /MarkWord/Images/saveas321.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/saveas321.png -------------------------------------------------------------------------------- /MarkWord/Images/select16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/select16.png -------------------------------------------------------------------------------- /MarkWord/Images/send32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/send32.png -------------------------------------------------------------------------------- /MarkWord/Images/sort16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/sort16.png -------------------------------------------------------------------------------- /MarkWord/Images/strikethru16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/strikethru16.png -------------------------------------------------------------------------------- /MarkWord/Images/style16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/style16.png -------------------------------------------------------------------------------- /MarkWord/Images/style_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/style_add.png -------------------------------------------------------------------------------- /MarkWord/Images/style_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/style_edit.png -------------------------------------------------------------------------------- /MarkWord/Images/stylechange32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/stylechange32.png -------------------------------------------------------------------------------- /MarkWord/Images/styleset16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/styleset16.png -------------------------------------------------------------------------------- /MarkWord/Images/subindex16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/subindex16.png -------------------------------------------------------------------------------- /MarkWord/Images/superindex16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/superindex16.png -------------------------------------------------------------------------------- /MarkWord/Images/symbol_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/symbol_check.png -------------------------------------------------------------------------------- /MarkWord/Images/tableCellPadding.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/tableCellPadding.gif -------------------------------------------------------------------------------- /MarkWord/Images/textBottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/textBottom.png -------------------------------------------------------------------------------- /MarkWord/Images/textTop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/textTop.png -------------------------------------------------------------------------------- /MarkWord/Images/text_signature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/text_signature.png -------------------------------------------------------------------------------- /MarkWord/Images/textaligncenter16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/textaligncenter16.png -------------------------------------------------------------------------------- /MarkWord/Images/textalignjustify16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/textalignjustify16.png -------------------------------------------------------------------------------- /MarkWord/Images/textalignleft16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/textalignleft16.png -------------------------------------------------------------------------------- /MarkWord/Images/textalignright16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/textalignright16.png -------------------------------------------------------------------------------- /MarkWord/Images/themefont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/themefont.png -------------------------------------------------------------------------------- /MarkWord/Images/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/title.png -------------------------------------------------------------------------------- /MarkWord/Images/title1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/title1.png -------------------------------------------------------------------------------- /MarkWord/Images/title2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/title2.png -------------------------------------------------------------------------------- /MarkWord/Images/title3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/title3.png -------------------------------------------------------------------------------- /MarkWord/Images/title4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/title4.png -------------------------------------------------------------------------------- /MarkWord/Images/title5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/title5.png -------------------------------------------------------------------------------- /MarkWord/Images/title6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/title6.png -------------------------------------------------------------------------------- /MarkWord/Images/underline16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/underline16.png -------------------------------------------------------------------------------- /MarkWord/Images/undo16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/undo16.png -------------------------------------------------------------------------------- /MarkWord/Images/unorderedlist16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/unorderedlist16.png -------------------------------------------------------------------------------- /MarkWord/Images/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/upload.png -------------------------------------------------------------------------------- /MarkWord/Images/user_male_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/user_male_16.png -------------------------------------------------------------------------------- /MarkWord/Images/word2003doc32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/word2003doc32.png -------------------------------------------------------------------------------- /MarkWord/Images/worddocument32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/worddocument32.png -------------------------------------------------------------------------------- /MarkWord/Images/wordtemplate32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Images/wordtemplate32.png -------------------------------------------------------------------------------- /MarkWord/MarkEditer.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 16 | 17 | 18 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /MarkWord/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // 有关程序集的一般信息由以下 8 | // 控制。更改这些特性值可修改 9 | // 与程序集关联的信息。 10 | [assembly: AssemblyTitle("MarkWord")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("墨云软件")] 14 | [assembly: AssemblyProduct("MarkWord")] 15 | [assembly: AssemblyCopyright("Copyright © 2016")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | //将 ComVisible 设置为 false 将使此程序集中的类型 20 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 21 | //请将此类型的 ComVisible 特性设置为 true。 22 | [assembly: ComVisible(false)] 23 | 24 | //若要开始生成可本地化的应用程序,请 25 | // 中的 .csproj 文件中 26 | //例如,如果您在源文件中使用的是美国英语, 27 | //使用的是美国英语,请将 设置为 en-US。 然后取消 28 | //对以下 NeutralResourceLanguage 特性的注释。 更新 29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置 36 | //(当资源未在页面 37 | //或应用程序资源字典中找到时使用) 38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 39 | //(当资源未在页面 40 | //、应用程序或任何主题专用资源字典中找到时使用) 41 | )] 42 | 43 | 44 | // 程序集的版本信息由下列四个值组成: 45 | // 46 | // 主版本 47 | // 次版本 48 | // 生成号 49 | // 修订号 50 | // 51 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 52 | // 方法是按如下所示使用“*”: : 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.5.0.0")] 55 | [assembly: AssemblyFileVersion("1.5.0.0")] 56 | -------------------------------------------------------------------------------- /MarkWord/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace MarkWord.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// 返回此类使用的缓存的 ResourceManager 实例。 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MarkWord.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 使用此强类型资源类,为所有资源查找 51 | /// 重写当前线程的 CurrentUICulture 属性。 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// 查找类似 /* GitHub stylesheet for MarkdownPad (http://markdownpad.com) */ 65 | ////* Author: Nicolas Hery - http://nicolashery.com */ 66 | ////* Version: b13fe65ca28d2e568c6ed5d7f06581183df8f2ff */ 67 | ////* Source: https://github.com/nicolahery/markdownpad-github */ 68 | /// 69 | ////* RESET 70 | ///=============================================================================*/ 71 | /// 72 | ///html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, s [字符串的其余部分被截断]"; 的本地化字符串。 73 | /// 74 | internal static string DefaultStyle { 75 | get { 76 | return ResourceManager.GetString("DefaultStyle", resourceCulture); 77 | } 78 | } 79 | 80 | /// 81 | /// 查找类似 <!--sublog 82 | ///{ 83 | /// "title":"Sublog: 支持Markdown和语法高亮的跨平台博客客户端", 84 | /// "category":"Thinking", 85 | /// "tags":"", 86 | /// "publish":"true", 87 | /// "blog_id":"3151861" 88 | ///} 89 | ///sublog--> 90 | /// 91 | ///灵感来自[米米饭](http://www.cnblogs.com/meetrice/archive/2013/02/14/2911238.html) 92 | /// 93 | ///## 功能一览 94 | ///[为什么你应该试试用Sublog写博客](http://www.cnblogs.com/zhengwenwei/p/3175646.html) 95 | /// 96 | ///## 项目主页: 97 | ///[sublog](https://github.com/AmongOthers/sublog) 98 | /// 99 | /// 100 | ///## 使用方法: 101 | /// 102 | ///1. 本项目是一个插件,首先要安装[Sublime Text 2](http://www.sublimetext.com/2) 103 | /// 104 | ///1. 重命名sublog.sublime-settings.exampl [字符串的其余部分被截断]"; 的本地化字符串。 105 | /// 106 | internal static string test { 107 | get { 108 | return ResourceManager.GetString("test", resourceCulture); 109 | } 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /MarkWord/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\DefaultStyle.css;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312 123 | 124 | 125 | ..\Resources\test.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312 126 | 127 | -------------------------------------------------------------------------------- /MarkWord/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace MarkWord.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MarkWord/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /MarkWord/Resources/DefaultStyle.css: -------------------------------------------------------------------------------- 1 | /* GitHub stylesheet for MarkdownPad (http://markdownpad.com) */ 2 | /* Author: Nicolas Hery - http://nicolashery.com */ 3 | /* Version: b13fe65ca28d2e568c6ed5d7f06581183df8f2ff */ 4 | /* Source: https://github.com/nicolahery/markdownpad-github */ 5 | 6 | /* RESET 7 | =============================================================================*/ 8 | 9 | html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { 10 | margin: 0; 11 | padding: 0; 12 | border: 0; 13 | } 14 | 15 | /* BODY 16 | =============================================================================*/ 17 | 18 | body { 19 | font-family: Helvetica, arial, freesans, clean, sans-serif; 20 | font-size: 14px; 21 | line-height: 1.6; 22 | color: #333; 23 | background-color: #fff; 24 | padding: 20px; 25 | max-width: 960px; 26 | margin: 0 auto; 27 | } 28 | 29 | body>*:first-child { 30 | margin-top: 0 !important; 31 | } 32 | 33 | body>*:last-child { 34 | margin-bottom: 0 !important; 35 | } 36 | 37 | /* BLOCKS 38 | =============================================================================*/ 39 | 40 | p, blockquote, ul, ol, dl, table, pre { 41 | margin: 15px 0; 42 | } 43 | 44 | /* HEADERS 45 | =============================================================================*/ 46 | 47 | h1, h2, h3, h4, h5, h6 { 48 | margin: 20px 0 10px; 49 | padding: 0; 50 | font-weight: bold; 51 | -webkit-font-smoothing: antialiased; 52 | } 53 | 54 | h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code { 55 | font-size: inherit; 56 | } 57 | 58 | h1 { 59 | font-size: 28px; 60 | color: #000; 61 | } 62 | 63 | h2 { 64 | font-size: 24px; 65 | border-bottom: 1px solid #ccc; 66 | color: #000; 67 | } 68 | 69 | h3 { 70 | font-size: 18px; 71 | } 72 | 73 | h4 { 74 | font-size: 16px; 75 | } 76 | 77 | h5 { 78 | font-size: 14px; 79 | } 80 | 81 | h6 { 82 | color: #777; 83 | font-size: 14px; 84 | } 85 | 86 | body>h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h4:first-child, body>h5:first-child, body>h6:first-child { 87 | margin-top: 0; 88 | padding-top: 0; 89 | } 90 | 91 | a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { 92 | margin-top: 0; 93 | padding-top: 0; 94 | } 95 | 96 | h1+p, h2+p, h3+p, h4+p, h5+p, h6+p { 97 | margin-top: 10px; 98 | } 99 | 100 | /* LINKS 101 | =============================================================================*/ 102 | 103 | a { 104 | color: #4183C4; 105 | text-decoration: none; 106 | } 107 | 108 | a:hover { 109 | text-decoration: underline; 110 | } 111 | 112 | /* LISTS 113 | =============================================================================*/ 114 | 115 | ul, ol { 116 | padding-left: 30px; 117 | } 118 | 119 | ul li > :first-child, 120 | ol li > :first-child, 121 | ul li ul:first-of-type, 122 | ol li ol:first-of-type, 123 | ul li ol:first-of-type, 124 | ol li ul:first-of-type { 125 | margin-top: 0px; 126 | } 127 | 128 | ul ul, ul ol, ol ol, ol ul { 129 | margin-bottom: 0; 130 | } 131 | 132 | dl { 133 | padding: 0; 134 | } 135 | 136 | dl dt { 137 | font-size: 14px; 138 | font-weight: bold; 139 | font-style: italic; 140 | padding: 0; 141 | margin: 15px 0 5px; 142 | } 143 | 144 | dl dt:first-child { 145 | padding: 0; 146 | } 147 | 148 | dl dt>:first-child { 149 | margin-top: 0px; 150 | } 151 | 152 | dl dt>:last-child { 153 | margin-bottom: 0px; 154 | } 155 | 156 | dl dd { 157 | margin: 0 0 15px; 158 | padding: 0 15px; 159 | } 160 | 161 | dl dd>:first-child { 162 | margin-top: 0px; 163 | } 164 | 165 | dl dd>:last-child { 166 | margin-bottom: 0px; 167 | } 168 | 169 | /* CODE 170 | =============================================================================*/ 171 | 172 | pre, code, tt { 173 | font-size: 12px; 174 | font-family: Consolas, "Liberation Mono", Courier, monospace; 175 | } 176 | 177 | code, tt { 178 | margin: 0 0px; 179 | padding: 0px 0px; 180 | white-space: nowrap; 181 | border: 1px solid #eaeaea; 182 | background-color: #f8f8f8; 183 | border-radius: 3px; 184 | } 185 | 186 | pre>code { 187 | margin: 0; 188 | padding: 0; 189 | white-space: pre; 190 | border: none; 191 | background: transparent; 192 | } 193 | 194 | pre { 195 | background-color: #f8f8f8; 196 | border: 1px solid #ccc; 197 | font-size: 13px; 198 | line-height: 19px; 199 | overflow: auto; 200 | padding: 6px 10px; 201 | border-radius: 3px; 202 | } 203 | 204 | pre code, pre tt { 205 | background-color: transparent; 206 | border: none; 207 | } 208 | 209 | kbd { 210 | -moz-border-bottom-colors: none; 211 | -moz-border-left-colors: none; 212 | -moz-border-right-colors: none; 213 | -moz-border-top-colors: none; 214 | background-color: #DDDDDD; 215 | background-image: linear-gradient(#F1F1F1, #DDDDDD); 216 | background-repeat: repeat-x; 217 | border-color: #DDDDDD #CCCCCC #CCCCCC #DDDDDD; 218 | border-image: none; 219 | border-radius: 2px 2px 2px 2px; 220 | border-style: solid; 221 | border-width: 1px; 222 | font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; 223 | line-height: 10px; 224 | padding: 1px 4px; 225 | } 226 | 227 | /* QUOTES 228 | =============================================================================*/ 229 | 230 | blockquote { 231 | border-left: 4px solid #DDD; 232 | padding: 0 15px; 233 | color: #777; 234 | } 235 | 236 | blockquote>:first-child { 237 | margin-top: 0px; 238 | } 239 | 240 | blockquote>:last-child { 241 | margin-bottom: 0px; 242 | } 243 | 244 | /* HORIZONTAL RULES 245 | =============================================================================*/ 246 | 247 | hr { 248 | clear: both; 249 | margin: 15px 0; 250 | height: 0px; 251 | overflow: hidden; 252 | border: none; 253 | background: transparent; 254 | border-bottom: 4px solid #ddd; 255 | padding: 0; 256 | } 257 | 258 | /* TABLES 259 | =============================================================================*/ 260 | 261 | 262 | table { 263 | font-family: Helvetica, arial, freesans, clean, sans-serif; 264 | font-size: 12px; 265 | empty-cells: show; 266 | border-collapse: collapse; 267 | margin: 20px 0 0 0; 268 | } 269 | 270 | td { 271 | height: 30px; 272 | } 273 | 274 | .table { 275 | border: 1px solid #cad9ea; 276 | color: #666; 277 | } 278 | 279 | .table th { 280 | background-repeat: repeat-x; 281 | height: 30px; 282 | } 283 | 284 | .table td, .table th { 285 | border: 1px solid #cad9ea; 286 | padding: 0 2em 0; 287 | } 288 | 289 | /* IMAGES 290 | =============================================================================*/ 291 | 292 | img { 293 | max-width: 100% 294 | } 295 | -------------------------------------------------------------------------------- /MarkWord/Resources/test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Twzy/MarkWord/67a27f019ed02cf87eb618aa7c2605ae7819ab2d/MarkWord/Resources/test.txt -------------------------------------------------------------------------------- /MarkWord/Template/TemplateStyle.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 12 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /MarkWord/Utils/BlogsDocumentInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace MarkWord 7 | { 8 | /// 9 | /// 当前操作的标题信息 10 | /// 11 | [Serializable] 12 | public class BlogsDocumentInfo 13 | { 14 | /// 15 | /// 16 | /// 17 | public string Title { get; set; } 18 | 19 | public string MarkDownContent { get; set; } 20 | //主要用于更新 21 | public string PostId { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /MarkWord/Utils/BlogsInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace MarkWord 7 | { 8 | /// 9 | /// 当前博客信息 10 | /// 11 | [Serializable] 12 | public class BlogsInfo 13 | { 14 | internal string BlogsID { get; set; } 15 | 16 | internal string BlogsMetaweblogUrl { get; set; } 17 | 18 | internal string BlogsUserId { get; set; } 19 | 20 | internal string BlogsPassword { get; set; } 21 | 22 | internal bool BlogsRecodPassword { get; set; } 23 | 24 | internal string BlogsUrl { get; set; } 25 | 26 | internal string BlogsName { get; set; } 27 | 28 | internal string BlogsModel { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /MarkWord/Utils/Common.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Media; 8 | 9 | namespace MarkWord 10 | { 11 | /// 12 | /// 公共配置类型 13 | /// 14 | [Serializable] 15 | public class Common 16 | { 17 | /// 18 | /// 工作类型 19 | /// 20 | public WorkType WorkType { get; set; } 21 | /// 22 | /// 字体字符串 23 | /// 24 | public string EditFontStr { get; set; } 25 | /// 26 | /// 字体索引 27 | /// 28 | public int EditFontIndex { get; set; } 29 | 30 | /// 31 | /// 是否显示行号 32 | /// 33 | public bool LineBar { get; set; } 34 | 35 | public bool ShowEndVl { get; set; } 36 | 37 | public bool ShowTabs { get; set; } 38 | 39 | public bool ShowSpace { get; set; } 40 | 41 | public bool ShowHightLine { get; set; } 42 | 43 | public Color BackGround { get; set; } 44 | 45 | public string StyleName { get; set; } 46 | /// 47 | /// 签名 48 | /// 49 | public string Signatrue { get; set; } 50 | 51 | public ThemeStyle Theme { get; set; } 52 | 53 | public List FileList { get; set; } 54 | 55 | public static void ShowMessage(string msg) 56 | { 57 | MessageBox.Show(msg); 58 | } 59 | 60 | public static MessageBoxResult ShowCorfmMessage(string msg) 61 | { 62 | return MessageBox.Show(msg, "提示", MessageBoxButton.YesNoCancel); 63 | } 64 | public static TextBlock labStatus { get; set; } 65 | 66 | public static void ShowStatusMessage(string msg) 67 | { 68 | labStatus.Text = msg; 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /MarkWord/Utils/Config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace MarkWord 7 | { 8 | /// 9 | /// 配置类型 10 | /// 11 | public class Config 12 | { 13 | /// 14 | /// 初始化 15 | /// 16 | static Config() 17 | { 18 | Common = new Common();//基本配置信息 19 | Common.WorkType = WorkType.Both; 20 | Common.EditFontStr = "Consolas"; 21 | Common.EditFontIndex = 6; 22 | Common.LineBar = true; 23 | Common.ShowEndVl = false; 24 | Common.ShowTabs = false; 25 | Common.ShowSpace = false; 26 | Common.ShowHightLine = false; 27 | Common.BackGround = System.Windows.Media.Colors.Transparent; 28 | Common.StyleName = "DefaultStyle"; 29 | Common.Signatrue = ""; 30 | Common.Theme = ThemeStyle.Office2013; 31 | Common.FileList = new List(); 32 | 33 | Blogs = new BlogsInfo();//博客配置信息 34 | CurrBlogsDocument = new BlogsDocumentInfo();//当前选择的文章的信息(主要用于草稿更新) 35 | imgcacheDir = System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, "imgcache"); 36 | if (!System.IO.Directory.Exists(imgcacheDir)) 37 | { 38 | System.IO.Directory.CreateDirectory(imgcacheDir); 39 | } 40 | 41 | } 42 | 43 | 44 | public static string imgcacheDir { get; set; } 45 | 46 | public static string AutoListDir { get; set; } 47 | 48 | public static List CustomAutoList { get; set; } = new List(); 49 | /// 50 | /// 当前选择的文章的信息(主要用于草稿更新) 51 | /// 52 | public static BlogsDocumentInfo CurrBlogsDocument { get; set; } 53 | /// 54 | /// 博客配置信息 55 | /// 56 | public static BlogsInfo Blogs { get; set; } 57 | 58 | /// 59 | /// 配置信息 60 | /// 61 | public static Common Common { get; set; } 62 | 63 | /// 64 | /// 样式文件夹 65 | /// 66 | public static string StyleDir 67 | { 68 | get 69 | { 70 | return Environment.CurrentDirectory + "\\Source\\Style"; 71 | } 72 | } 73 | /// 74 | /// 脚本文件夹 75 | /// 76 | public static string ScriptDir 77 | { 78 | get 79 | { 80 | return Environment.CurrentDirectory + "\\Source\\Script"; 81 | } 82 | } 83 | 84 | /// 85 | /// 配置文件 86 | /// 87 | public static string ConfigFile 88 | { 89 | get 90 | { 91 | return Environment.CurrentDirectory + "\\Config\\MainSetting.xml"; 92 | } 93 | } 94 | 95 | 96 | public static string MarkdownHelp 97 | { 98 | get 99 | { 100 | return Environment.CurrentDirectory + "\\Config\\markword.html"; 101 | } 102 | } 103 | 104 | public static string MyDocumentFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\MarkWord\\"; 105 | 106 | /// 107 | /// 博客配置文件,保存在一些特殊的文件夹下,防止因为直接复制软件而造成账号泄露 108 | /// 109 | public static string BlogsConfigFile 110 | { 111 | get 112 | { 113 | return MyDocumentFolder + "\\setting.bin"; 114 | } 115 | } 116 | 117 | /// 118 | /// 样式字符字符串 119 | /// 120 | public static string Style { get; set; } 121 | 122 | public static Dictionary StyleList { get; internal set; } 123 | 124 | /// 125 | /// 标题 126 | /// 127 | public static string Title 128 | { 129 | get 130 | { 131 | return "MarkWord"; 132 | } 133 | } 134 | 135 | 136 | 137 | 138 | /// 139 | /// 读取配置信息 140 | /// 141 | public static void ReadConfig() 142 | { 143 | if (!System.IO.File.Exists(ConfigFile)) 144 | { 145 | return; 146 | } 147 | Config.Common = Tools.ReadByXML(ConfigFile); 148 | 149 | 150 | } 151 | 152 | /// 153 | /// 保存配置信息 154 | /// 155 | public static void SaveConfig() 156 | { 157 | Tools.WriteByXML(Config.Common, ConfigFile); 158 | } 159 | 160 | 161 | /// 162 | /// 读取博客信息 163 | /// 164 | public static void ReadBlogsConfig() 165 | { 166 | //加载博客信息 167 | if (!System.IO.File.Exists(Config.BlogsConfigFile)) 168 | { 169 | return; 170 | } 171 | try 172 | { 173 | Config.Blogs = Tools.ReadByBinary(Config.BlogsConfigFile); 174 | } 175 | catch (Exception ex) 176 | { } 177 | } 178 | 179 | /// 180 | /// 保存博客信息 181 | /// 182 | public static void SaveBlogsConfig() 183 | { 184 | Tools.WriteByBinary(Config.Blogs, Config.BlogsConfigFile); 185 | } 186 | 187 | 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /MarkWord/Utils/DisplayHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace MarkWord 7 | { 8 | public delegate void DisplayHandler(); 9 | } 10 | -------------------------------------------------------------------------------- /MarkWord/Utils/PublishInfoHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace MarkWord 7 | { 8 | /// 9 | /// 用于展示发布进度 10 | /// 11 | /// 12 | /// 13 | /// 14 | public delegate void PublishInfoHandler(int maxcount, int value, string msg); 15 | } 16 | -------------------------------------------------------------------------------- /MarkWord/Utils/ThemeStyle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace MarkWord 7 | { 8 | /// 9 | /// 主题管理 10 | /// 11 | public enum ThemeStyle 12 | { 13 | Office2013, 14 | Office2010 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MarkWord/Utils/WorkType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace MarkWord 7 | { 8 | /// 9 | /// 工作类型 10 | /// 11 | public enum WorkType : byte 12 | { 13 | /// 14 | /// 编辑模式 15 | /// 16 | Edit = 0, 17 | /// 18 | /// 浏览模式 19 | /// 20 | Display = 1, 21 | 22 | /// 23 | /// 同步预览模式 24 | /// 25 | Both = 2 26 | 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /MarkWord/ViewModels/ColorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Media; 3 | 4 | 5 | namespace MarkWord.ViewModels 6 | { 7 | 8 | public class ColorViewModel : ViewModel 9 | { 10 | private Color standardColor; 11 | private Color highlightColor; 12 | 13 | public ColorViewModel() 14 | { 15 | this.StandardColor = Colors.Black; 16 | this.HighlightColor = Colors.Yellow; 17 | } 18 | 19 | public Color StandardColor 20 | { 21 | get { return this.standardColor; } 22 | set 23 | { 24 | this.standardColor = value; 25 | this.OnPropertyChanged(nameof(this.StandardColor)); 26 | } 27 | } 28 | 29 | public Color HighlightColor 30 | { 31 | get { return this.highlightColor; } 32 | set 33 | { 34 | this.highlightColor = value; 35 | this.OnPropertyChanged(nameof(this.HighlightColor)); 36 | } 37 | } 38 | 39 | public Color[] ThemeColors { get; } = { Colors.Red, Colors.Green, Colors.Blue, Colors.White, Colors.Black, Colors.Purple }; 40 | 41 | public Color ThemeColor 42 | { 43 | get { return ((SolidColorBrush)Application.Current.Resources["RibbonThemeColorBrush"])?.Color ?? Colors.Pink; } 44 | set 45 | { 46 | Application.Current.Resources["RibbonThemeColorBrush"] = new SolidColorBrush(value); 47 | this.OnPropertyChanged(nameof(this.ThemeColor)); 48 | } 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /MarkWord/ViewModels/FontsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace MarkWord.ViewModels 4 | { 5 | using System.Linq; 6 | 7 | public class FontsViewModel : ViewModel 8 | { 9 | public ObservableCollection FontsData 10 | { 11 | get 12 | { 13 | return new ObservableCollection(System.Windows.Media.Fonts.SystemFontFamilies.Select(fontFamily => fontFamily.ToString())); 14 | 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MarkWord/ViewModels/ViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using JetBrains.Annotations; 3 | 4 | namespace MarkWord.ViewModels 5 | { 6 | 7 | 8 | public class ViewModel : INotifyPropertyChanged 9 | { 10 | public event PropertyChangedEventHandler PropertyChanged = delegate { }; 11 | 12 | [NotifyPropertyChangedInvocator] 13 | protected void OnPropertyChanged(string propertyName) 14 | { 15 | this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /MarkWord/WebDoc.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /MarkWord/WebDoc.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace MarkWord 16 | { 17 | /// 18 | /// WebDoc.xaml 的交互逻辑 19 | /// 20 | public partial class WebDoc : UserControl 21 | { 22 | 23 | 24 | public WebDoc() 25 | { 26 | InitializeComponent(); 27 | 28 | IniteWebBrowser(); 29 | } 30 | //winForm webBrowser 31 | public System.Windows.Forms.WebBrowser winWebDoc; 32 | //Awesomium.Windows.Forms.WebControl winWebDoc; 33 | /// 34 | /// 初始化 35 | /// 36 | private void IniteWebBrowser() 37 | { 38 | winWebDoc = new System.Windows.Forms.WebBrowser(); 39 | winWebDoc.ScriptErrorsSuppressed = true; 40 | winWebDoc.AllowNavigation = false; 41 | winWebDoc.AllowWebBrowserDrop = false; 42 | winWebDoc.WebBrowserShortcutsEnabled = false; 43 | winWebDoc.IsWebBrowserContextMenuEnabled = false; 44 | winWebDoc.NewWindow += WinWebDoc_NewWindow; 45 | winWebDoc.Dock = System.Windows.Forms.DockStyle.Fill; 46 | docViewer.Child = winWebDoc; 47 | 48 | 49 | //winWebDoc = new Awesomium.Windows.Forms.WebControl(); 50 | //winWebDoc.Dock = System.Windows.Forms.DockStyle.Fill; 51 | //winWebDoc.Size = new System.Drawing.Size(10, 10); 52 | //docViewer.Child = winWebDoc; 53 | 54 | } 55 | 56 | private void WinWebDoc_NewWindow(object sender, System.ComponentModel.CancelEventArgs e) 57 | { 58 | e.Cancel = true; 59 | } 60 | 61 | 62 | 63 | /// 64 | /// 加载样式 65 | /// 66 | /// 67 | /// 68 | public void LoadAllHTML(string MarkValue) 69 | { 70 | if (winWebDoc.Document == null) 71 | { 72 | winWebDoc.DocumentText = ""; 73 | } 74 | else 75 | { 76 | winWebDoc.Document.OpenNew(true); 77 | } 78 | winWebDoc.Document.Write(BLL.HtmlHelper.MarkToHTMlPage(MarkValue)); 79 | // winWebDoc.LoadHTML(BLL.HtmlHelper.MarkToHTMlPage(MarkValue)); 80 | } 81 | 82 | 83 | 84 | 85 | 86 | /// 87 | /// 添加web数据 88 | /// 89 | /// 90 | public void LoadBody(string MarkValue) 91 | { 92 | 93 | if (winWebDoc.Document == null) 94 | return; 95 | winWebDoc.Document.InvokeScript("updatePageContent", new object[] { CommonMark.CommonMarkConverter.Convert(MarkValue) }); 96 | } 97 | 98 | 99 | public void ScrollAuto(double value) 100 | { 101 | if (winWebDoc.Document == null) 102 | return; 103 | winWebDoc.Document.InvokeScript("scrollToPageContent", new object[] { value.ToString(System.Globalization.CultureInfo.InvariantCulture) }); 104 | //if (!winWebDoc.IsDocumentReady) 105 | // return; 106 | //string javascript = "(function(){ alert(document.body.scrollHeight - document.body.clientHeight); })(); "; //string.Format("(function(val){{ scrollToPageContent(val);}})({0});", value.ToString(System.Globalization.CultureInfo.InvariantCulture)); 107 | //winWebDoc.ExecuteJavascript(javascript); 108 | } 109 | 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /MarkWord/WinAddSnippet.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /MarkWord/WinAddSnippet.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Shapes; 13 | 14 | namespace MarkWord 15 | { 16 | /// 17 | /// WinAddSnippet.xaml 的交互逻辑 18 | /// 19 | public partial class WinAddSnippet : Window 20 | { 21 | public WinAddSnippet() 22 | { 23 | InitializeComponent(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MarkWord/WinBlogsLogin.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 67 | 68 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /MarkWord/WinStyleSelected.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Shapes; 13 | using Fluent; 14 | using ICSharpCode.AvalonEdit.Highlighting; 15 | using System.IO; 16 | namespace MarkWord 17 | { 18 | /// 19 | /// WinStyleSelected.xaml 的交互逻辑 20 | /// 21 | public partial class WinStyleSelected 22 | { 23 | public WinStyleSelected() 24 | { 25 | InitializeComponent(); 26 | 27 | cssEditer.textEditor.SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("CSS"); 28 | cssEditer.border.Margin = new Thickness(0); 29 | cssEditer.textEditor.Margin = new Thickness(0); 30 | 31 | 32 | } 33 | 34 | 35 | public bool StyleAddModel = false; 36 | 37 | 38 | private void RibbonWindow_Loaded(object sender, RoutedEventArgs e) 39 | { 40 | if (StyleAddModel) 41 | { 42 | btnNewCss_Click(null, null); 43 | } 44 | else 45 | { 46 | string[] files = System.IO.Directory.GetFiles(Config.StyleDir); 47 | foreach (var f in files) 48 | { 49 | cbxStyleList.Items.Add(System.IO.Path.GetFileNameWithoutExtension(f)); 50 | } 51 | } 52 | } 53 | 54 | 55 | public bool NewSave() 56 | { 57 | string fileName = System.IO.Path.Combine(Config.StyleDir, cbxStyleList + ".css"); 58 | if (File.Exists(fileName)) 59 | { 60 | Common.ShowMessage("改样式名称已经存在,请重新命名。"); 61 | return false; 62 | } 63 | try 64 | { 65 | File.WriteAllText(fileName, cssEditer.textEditor.Text, Encoding.UTF8); 66 | return true; 67 | } 68 | catch (Exception ex) 69 | { 70 | Common.ShowMessage("保存样式异常:" + ex.Message); 71 | return false; 72 | } 73 | } 74 | 75 | public bool EditSave() 76 | { 77 | string fileName = System.IO.Path.Combine(Config.StyleDir, cbxStyleList.Text + ".css"); 78 | try 79 | { 80 | File.WriteAllText(fileName, cssEditer.textEditor.Text, Encoding.UTF8); 81 | return true; 82 | } 83 | catch (Exception ex) 84 | { 85 | Common.ShowMessage("保存样式异常:" + ex.Message); 86 | return false; 87 | } 88 | } 89 | 90 | private void btnNewCss_Click(object sender, RoutedEventArgs e) 91 | { 92 | cbxStyleList.IsEditable = true; 93 | cbxStyleList.Text = "newStyle_" + DateTime.Now.ToLocalTime().ToString("yyyyMMddHHmmss"); 94 | cssEditer.textEditor.Text = @"/* 95 | 开始编辑," + DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss") + @" 96 | */"; 97 | 98 | } 99 | 100 | private void btnSave_Click(object sender, RoutedEventArgs e) 101 | { 102 | if (StyleAddModel) 103 | { 104 | NewSave(); 105 | } 106 | else 107 | { 108 | EditSave(); 109 | } 110 | } 111 | 112 | private void cbxStyleList_SelectionChanged(object sender, SelectionChangedEventArgs e) 113 | { 114 | string fileName = System.IO.Path.Combine(Config.StyleDir, cbxStyleList.Text + ".css"); 115 | if (!File.Exists(fileName)) 116 | { 117 | cssEditer.textEditor.Text = @"/* 118 | 无可用数据 119 | */"; 120 | return; 121 | } 122 | cssEditer.textEditor.Text = File.ReadAllText(fileName, Encoding.UTF8); 123 | } 124 | 125 | 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /MarkWord/WinTableConvert.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 17 | 25 | 26 | 27 | 28 |