Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
DataEditorX
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
聖園ミカ
DataEditorX
Commits
e754a792
Commit
e754a792
authored
Jun 09, 2020
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code format
parent
bf666c10
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
26 deletions
+24
-26
DataEditorX/Language/LanguageHelper.cs
DataEditorX/Language/LanguageHelper.cs
+14
-14
DataEditorX/MainForm.cs
DataEditorX/MainForm.cs
+6
-8
DataEditorX/MainForm.resx
DataEditorX/MainForm.resx
+4
-4
No files found.
DataEditorX/Language/LanguageHelper.cs
View file @
e754a792
...
...
@@ -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
]);
}
}
}
...
...
DataEditorX/MainForm.cs
View file @
e754a792
...
...
@@ -548,16 +548,14 @@ 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结束,则线程终止
};
th
.
Start
();
}
Thread
th
=
new
Thread
(
this
.
CheckUpdate
)
{
IsBackground
=
true
//如果exe结束,则线程终止
};
th
.
Start
();
}
}
}
DataEditorX/MainForm.resx
View file @
e754a792
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment