Commit e754a792 authored by JoyJ's avatar JoyJ

code format

parent bf666c10
...@@ -19,8 +19,8 @@ namespace DataEditorX.Language ...@@ -19,8 +19,8 @@ namespace DataEditorX.Language
/// </summary> /// </summary>
public class LanguageHelper public class LanguageHelper
{ {
static readonly Dictionary<string, string> gWordsList = new Dictionary<string, string>(); static readonly Dictionary<string, string> _gWordsList = new Dictionary<string, string>();
static readonly SortedList<LMSG, string> gMsgList = new SortedList<LMSG, string>(); static readonly SortedList<LMSG, string> _gMsgList = new SortedList<LMSG, string>();
const char SEP_CONTROL = '.'; const char SEP_CONTROL = '.';
const char SEP_LINE = '\t'; const char SEP_LINE = '\t';
readonly Dictionary<string, string> mWordslist = new Dictionary<string, string>(); readonly Dictionary<string, string> mWordslist = new Dictionary<string, string>();
...@@ -28,9 +28,9 @@ public class LanguageHelper ...@@ -28,9 +28,9 @@ public class LanguageHelper
#region 获取消息文字 #region 获取消息文字
public static string GetMsg(LMSG lMsg) public static string GetMsg(LMSG lMsg)
{ {
if (gMsgList.IndexOfKey(lMsg) >= 0) if (_gMsgList.IndexOfKey(lMsg) >= 0)
{ {
return gMsgList[lMsg]; return _gMsgList[lMsg];
} }
else else
{ {
...@@ -59,7 +59,7 @@ public static void SetFormLabel(Form fm) ...@@ -59,7 +59,7 @@ public static void SetFormLabel(Form fm)
static bool GetLabel(string key, out string title) static bool GetLabel(string key, out string title)
{ {
if (gWordsList.TryGetValue(key, out string v)) if (_gWordsList.TryGetValue(key, out string v))
{ {
title = v; title = v;
return true; return true;
...@@ -262,14 +262,14 @@ public bool SaveLanguage(string conf) ...@@ -262,14 +262,14 @@ public bool SaveLanguage(string conf)
sw.WriteLine(k + SEP_LINE + this.mWordslist[k]); sw.WriteLine(k + SEP_LINE + this.mWordslist[k]);
} }
sw.WriteLine("#"); sw.WriteLine("#");
foreach (LMSG k in gMsgList.Keys) foreach (LMSG k in _gMsgList.Keys)
{ {
//记得替换换行符 //记得替换换行符
sw.WriteLine("0x" + ((uint)k).ToString("x") + SEP_LINE + gMsgList[k].Replace("\n", "\\n")); sw.WriteLine("0x" + ((uint)k).ToString("x") + SEP_LINE + _gMsgList[k].Replace("\n", "\\n"));
} }
foreach (LMSG k in Enum.GetValues(typeof(LMSG))) foreach (LMSG k in Enum.GetValues(typeof(LMSG)))
{ {
if (!gMsgList.ContainsKey(k)) if (!_gMsgList.ContainsKey(k))
{ {
sw.WriteLine("0x" + ((uint)k).ToString("x") + SEP_LINE + k.ToString()); sw.WriteLine("0x" + ((uint)k).ToString("x") + SEP_LINE + k.ToString());
} }
...@@ -289,8 +289,8 @@ public static void LoadFormLabels(string f) ...@@ -289,8 +289,8 @@ public static void LoadFormLabels(string f)
return; return;
} }
gWordsList.Clear(); _gWordsList.Clear();
gMsgList.Clear(); _gMsgList.Clear();
using (FileStream fs = new FileStream(f, FileMode.Open, FileAccess.Read)) using (FileStream fs = new FileStream(f, FileMode.Open, FileAccess.Read))
{ {
StreamReader sr = new StreamReader(fs, Encoding.UTF8); StreamReader sr = new StreamReader(fs, Encoding.UTF8);
...@@ -313,16 +313,16 @@ public static void LoadFormLabels(string f) ...@@ -313,16 +313,16 @@ public static void LoadFormLabels(string f)
{ {
uint.TryParse(words[0].Replace("0x", ""), NumberStyles.HexNumber, null, out uint utemp); uint.TryParse(words[0].Replace("0x", ""), NumberStyles.HexNumber, null, out uint utemp);
ltemp = (LMSG)utemp; ltemp = (LMSG)utemp;
if (gMsgList.IndexOfKey(ltemp) < 0)//记得替换换行符 if (_gMsgList.IndexOfKey(ltemp) < 0)//记得替换换行符
{ {
gMsgList.Add(ltemp, words[1].Replace("\\n", "\n")); _gMsgList.Add(ltemp, words[1].Replace("\\n", "\n"));
} }
} }
else if (!line.StartsWith("#"))//加载界面语言 else if (!line.StartsWith("#"))//加载界面语言
{ {
if (!gWordsList.ContainsKey(words[0])) if (!_gWordsList.ContainsKey(words[0]))
{ {
gWordsList.Add(words[0], words[1]); _gWordsList.Add(words[0], words[1]);
} }
} }
} }
......
...@@ -548,16 +548,14 @@ private void bgWorker1_RunWorkerCompleted(object sender, System.ComponentModel.R ...@@ -548,16 +548,14 @@ private void bgWorker1_RunWorkerCompleted(object sender, System.ComponentModel.R
private void MainForm_Load(object sender, EventArgs e) private void MainForm_Load(object sender, EventArgs e)
{ {
//检查更新 //检查更新
if (!MyConfig.ReadBoolean(MyConfig.TAG_AUTO_CHECK_UPDATE)) if (MyConfig.ReadBoolean(MyConfig.TAG_AUTO_CHECK_UPDATE))
{ {
return; Thread th = new Thread(this.CheckUpdate)
{
IsBackground = true//如果exe结束,则线程终止
};
th.Start();
} }
Thread th = new Thread(this.CheckUpdate)
{
IsBackground = true//如果exe结束,则线程终止
};
th.Start();
} }
} }
} }
...@@ -112,15 +112,15 @@ ...@@ -112,15 +112,15 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="mainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="mainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>237, 17</value> <value>237, 17</value>
</metadata> </metadata>
<metadata name="bgWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="bgWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>130, 17</value> <value>130, 17</value>
</metadata> </metadata>
</root> </root>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment