Commit e754a792 authored by JoyJ's avatar JoyJ

code format

parent bf666c10
......@@ -19,8 +19,8 @@ namespace DataEditorX.Language
/// </summary>
public class LanguageHelper
{
static readonly Dictionary<string, string> gWordsList = new Dictionary<string, string>();
static readonly SortedList<LMSG, string> gMsgList = new SortedList<LMSG, string>();
static readonly Dictionary<string, string> _gWordsList = new Dictionary<string, string>();
static readonly SortedList<LMSG, string> _gMsgList = new SortedList<LMSG, string>();
const char SEP_CONTROL = '.';
const char SEP_LINE = '\t';
readonly Dictionary<string, string> mWordslist = new Dictionary<string, string>();
......@@ -28,9 +28,9 @@ public class LanguageHelper
#region 获取消息文字
public static string GetMsg(LMSG lMsg)
{
if (gMsgList.IndexOfKey(lMsg) >= 0)
if (_gMsgList.IndexOfKey(lMsg) >= 0)
{
return gMsgList[lMsg];
return _gMsgList[lMsg];
}
else
{
......@@ -59,7 +59,7 @@ public static void SetFormLabel(Form fm)
static bool GetLabel(string key, out string title)
{
if (gWordsList.TryGetValue(key, out string v))
if (_gWordsList.TryGetValue(key, out string v))
{
title = v;
return true;
......@@ -262,14 +262,14 @@ public bool SaveLanguage(string conf)
sw.WriteLine(k + SEP_LINE + this.mWordslist[k]);
}
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)))
{
if (!gMsgList.ContainsKey(k))
if (!_gMsgList.ContainsKey(k))
{
sw.WriteLine("0x" + ((uint)k).ToString("x") + SEP_LINE + k.ToString());
}
......@@ -289,8 +289,8 @@ public static void LoadFormLabels(string f)
return;
}
gWordsList.Clear();
gMsgList.Clear();
_gWordsList.Clear();
_gMsgList.Clear();
using (FileStream fs = new FileStream(f, FileMode.Open, FileAccess.Read))
{
StreamReader sr = new StreamReader(fs, Encoding.UTF8);
......@@ -313,16 +313,16 @@ public static void LoadFormLabels(string f)
{
uint.TryParse(words[0].Replace("0x", ""), NumberStyles.HexNumber, null, out uint 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("#"))//加载界面语言
{
if (!gWordsList.ContainsKey(words[0]))
if (!_gWordsList.ContainsKey(words[0]))
{
gWordsList.Add(words[0], words[1]);
_gWordsList.Add(words[0], words[1]);
}
}
}
......
......@@ -548,11 +548,8 @@ private void bgWorker1_RunWorkerCompleted(object sender, System.ComponentModel.R
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结束,则线程终止
......@@ -560,4 +557,5 @@ private void MainForm_Load(object sender, EventArgs e)
th.Start();
}
}
}
}
......@@ -112,15 +112,15 @@
<value>2.0</value>
</resheader>
<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 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>
<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>
</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>
</metadata>
</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