Skip to content

Commit

Permalink
modify:save settings to a .config file,then can move style config
Browse files Browse the repository at this point in the history
  • Loading branch information
sunminghong committed Apr 21, 2011
1 parent 1614a98 commit 9905d18
Show file tree
Hide file tree
Showing 20 changed files with 307 additions and 161 deletions.
Binary file modified MEditor.suo
Binary file not shown.
18 changes: 1 addition & 17 deletions MarkdownEditorManager.cs
Expand Up @@ -34,7 +34,7 @@ public class MarkdownEditorManager

private Color _bgColor = Color.FromArgb(0x4a,0x52,0x5a);//20,0x20,0x20;
private Color _foreColor = Color.FromArgb(0xff,0xff,0xff); //0xf2,0xf0,0xdf
private Font _font = FONT;
private Font _font = new Font("微软雅黑", 12);

#region defaultCss
private string _defcss = @"
Expand Down Expand Up @@ -503,22 +503,6 @@ public void SetStyle(RichTextBox rtb)
rtb.WordWrap = _wordWrap;
}

public void SetOldStyle()
{
_bgColor = BGColor;
_foreColor = FOREColor;
_font = FONT;
SetStyle();
}

public void SetBlackWhiteStyle()
{
_bgColor = Color.FromArgb(0x4a,0x52,0x5a);//20,0x20,0x20;
_foreColor = Color.FromArgb(0xff,0xff,0xff); //0xf2,0xf0,0xdf
_font = FONT;
SetStyle();
}

public void SetBackColor(Color co)
{
if(_bgColor==co)
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Expand Up @@ -5,11 +5,11 @@
// 有关程序集的常规信息通过下列属性集
// 控制。更改这些属性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("MEditor")]
[assembly: AssemblyTitle("码德编辑器")]
[assembly: AssemblyDescription("Markdown文档编辑器,纯自由软件")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("YihuiStudio")]
[assembly: AssemblyProduct("MEditor")]
[assembly: AssemblyProduct("码德编辑器")]
[assembly: AssemblyCopyright("版权所有 (C) YihuiStudio 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand Down
135 changes: 79 additions & 56 deletions Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 38 additions & 12 deletions Properties/Settings.settings
Expand Up @@ -2,17 +2,17 @@
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="MEditor.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="font" Type="System.Drawing.Font" Scope="User">
<Setting Name="font" Type="System.Drawing.Font" Scope="Application">
<Value Profile="(Default)">微软雅黑, 10.5pt</Value>
</Setting>
<Setting Name="color" Type="System.Drawing.Color" Scope="User">
<Setting Name="color" Type="System.Drawing.Color" Scope="Application">
<Value Profile="(Default)">White</Value>
</Setting>
<Setting Name="bgcolor" Type="System.Drawing.Color" Scope="User">
<Setting Name="bgcolor" Type="System.Drawing.Color" Scope="Application">
<Value Profile="(Default)">74, 82, 90</Value>
</Setting>
<Setting Name="css" Type="System.String" Scope="User">
<Value Profile="(Default)">body,td,th {font-family:""微软雅黑"", Verdana, ""Bitstream Vera Sans"", sans-serif; }
<Setting Name="css" Type="System.String" Scope="Application">
<Value Profile="(Default)">body,td,th {font-family:"微软雅黑", Verdana, "Bitstream Vera Sans", sans-serif; }
body {
margin-top: 0;
padding: 0;
Expand Down Expand Up @@ -43,7 +43,7 @@ p {
}

h1 {
font-family: ""黑体"",""Gill Sans"", ""Gill Sans Std"", ""Gill Sans MT"", Georgia, serif;
font-family: "黑体","Gill Sans", "Gill Sans Std", "Gill Sans MT", Georgia, serif;
font-size: 1.55em;
line-height: 1.5em;
text-align: left;
Expand All @@ -52,7 +52,7 @@ h1 {
}

h2 {
font-family:""黑体"", ""Gill Sans"", ""Gill Sans Std"", ""Gill Sans MT"", Verdana, ""Bitstream Vera Sans"", sans-serif;
font-family:"黑体", "Gill Sans", "Gill Sans Std", "Gill Sans MT", Verdana, "Bitstream Vera Sans", sans-serif;
font-size: 1.1em; /* 1 */
text-align: left;
font-weight:bold;
Expand All @@ -70,7 +70,7 @@ h2 + h3 {
}

h3 {
font-family: ""黑体"",Gill Sans"", ""Gill Sans Std"", ""Gill Sans MT"", Verdana, ""Bitstream Vera Sans"", sans-serif;
font-family: "黑体",Gill Sans", "Gill Sans Std", "Gill Sans MT", Verdana, "Bitstream Vera Sans", sans-serif;
font-size: .91em;
text-align: left;
font-weight: normal;
Expand All @@ -93,7 +93,7 @@ h6 + h2 {
}

h4, h5, h6 {
font-family: Verdana, ""Bitstream Vera Sans"", sans-serif;
font-family: Verdana, "Bitstream Vera Sans", sans-serif;
font-size: 1em;
text-align: left;
font-weight: bold;
Expand Down Expand Up @@ -143,7 +143,7 @@ ul, ol {


pre {
font-family: ""Bitstream Vera Sans Mono"", Courier, Monaco, ProFont, ""American Typewriter"", ""Andale Mono"", monospace;
font-family: "Bitstream Vera Sans Mono", Courier, Monaco, ProFont, "American Typewriter", "Andale Mono", monospace;
line-height: 1.45em;
color: #{1};
background-color: inherit;
Expand All @@ -155,7 +155,7 @@ pre {
}

code {
font-family: Monaco, ProFont, ""Bitstream Vera Sans Mono"", ""American Typewriter"", ""Andale Mono"", monospace;
font-family: Monaco, ProFont, "Bitstream Vera Sans Mono", "American Typewriter", "Andale Mono", monospace;
font-size: 0.91em; /* 1.09em for Courier */
}

Expand All @@ -181,7 +181,7 @@ hr {
}

dt {
font-family: Verdana, ""Bitstream Vera Sans"", sans-serif;
font-family: Verdana, "Bitstream Vera Sans", sans-serif;
font-size: 1em;
text-align: left;
font-weight: normal;
Expand All @@ -203,5 +203,31 @@ border-collapse: separate;border-spacing: 0;
}
th,td{padding:5px;border: 1px solid #CCC;}</Value>
</Setting>
<Setting Name="appconfig" Type="System.String" Scope="User">
<Value Profile="(Default)">&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;configuration&gt;
&lt;configSections&gt;
&lt;sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" &gt;
&lt;section name="MEditor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
&lt;/sectionGroup&gt;
&lt;/configSections&gt;
&lt;applicationSettings&gt;
&lt;MEditor.Properties.Settings&gt;
&lt;setting name="font" serializeAs="String"&gt;
&lt;value&gt;{font}&lt;/value&gt;
&lt;/setting&gt;
&lt;setting name="color" serializeAs="String"&gt;
&lt;value&gt;{color}&lt;/value&gt;
&lt;/setting&gt;
&lt;setting name="bgcolor" serializeAs="String"&gt;
&lt;value&gt;{bgcolor}&lt;/value&gt;
&lt;/setting&gt;
&lt;setting name="css" serializeAs="String"&gt;
&lt;value&gt;{css}&lt;/value&gt;
&lt;/setting&gt;
&lt;/MEditor.Properties.Settings&gt;
&lt;/applicationSettings&gt;
&lt;/configuration&gt;</Value>
</Setting>
</Settings>
</SettingsFile>

0 comments on commit 9905d18

Please sign in to comment.