-
Notifications
You must be signed in to change notification settings - Fork 1
/
Language.cs
234 lines (174 loc) · 13.8 KB
/
Language.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
using System.Xml;
namespace CryptotextEditor
{
internal class Language
{
Editor editor;
ctxtproperties ctxtPropWindow;
internal Language(Editor e)
{
editor = e;
}
internal Language(ctxtproperties c)
{
ctxtPropWindow = c;
}
internal void changeLangEditor(string langName)
{
XmlDocument xFile = new XmlDocument();
XmlNode nodeText;
System.IO.FileInfo fi;
try
{
xFile.Load(langName);
fi = new System.IO.FileInfo(langName);
Settings.editorLangPath = "lang\\" + fi.Name;
nodeText = xFile.GetElementsByTagName("miFile").Item(0);
editor.MenuItemFile.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFileNew").Item(0);
editor.MenuItemFileNew.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.mtsNew.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFileOpen").Item(0);
editor.MenuItemFileOpen.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.mtsOpen.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFileSave").Item(0);
editor.MenuItemFileSave.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.mtsSave.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFileSaveAs").Item(0);
editor.MenuItemFileSaveAs.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFileCtxtProperties").Item(0);
editor.MenuItemFileProperties.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.mtsProperties.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFileHash").Item(0);
editor.MenuItemHashFile.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFileClose").Item(0);
editor.MenuItemFileClose.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEdit").Item(0);
editor.MenuItemEdit.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEditUndo").Item(0);
editor.MenuItemEditUndo.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.mtsUndo.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEditRedo").Item(0);
editor.MenuItemEditRedo.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.mtsRedo.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEditCut").Item(0);
editor.MenuItemEditCut.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.docMenuStripCut.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.mtsCut.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEditCopy").Item(0);
editor.MenuItemEditCopy.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.docMenuStripCopy.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.mtsCopy.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEditPaste").Item(0);
editor.MenuItemEditPaste.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.docMenuStripPaste.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.mtsPaste.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEditDelete").Item(0);
editor.MenuItemEditDelete.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEditMarkupAll").Item(0);
editor.MenuItemEditMarkupAll.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEditSearch").Item(0);
editor.MenuItemEditSearch.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.mtsSearch.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEditText").Item(0);
editor.MenuItemEditText.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.docMenuStripTextCase.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEditTextUp").Item(0);
editor.MenuItemEditTextUppercase.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.docMenuStripTextCaseUp.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEditTextLow").Item(0);
editor.MenuItemEditTextLowercase.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.docMenuStripTextCaseLower.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEditTextScentense").Item(0);
editor.MenuItemEditTextSentenceCase.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.docMenuStripTextCaseSentence.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEditTimeDate").Item(0);
editor.MenuItemEditTimeDate.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFormat").Item(0);
editor.MenuItemFormat.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFormatWordWrap").Item(0);
editor.MenuItemFormatWordWrap.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFormatDetectUrls").Item(0);
editor.MenuItemFormatDetectUrls.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFormatFont").Item(0);
editor.MenuItemFormatFont.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.docMenuStripFont.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.mtsFont.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFormatFontSize").Item(0);
editor.docMenuStripFontSize.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFormatAlig").Item(0);
editor.MenuItemFormatAlig.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFormatAligLeft").Item(0);
editor.MenuItemFormatAligLeft.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFormatAligCenter").Item(0);
editor.MenuItemFormatAligCenter.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFormatAligRight").Item(0);
editor.MenuItemFormatAligRight.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFormatToolBox").Item(0);
editor.MenuItemFormatToolbox.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miFormatReset").Item(0);
editor.MenuItemFormatReset.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.docMenuStripDefault.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEncryption").Item(0);
editor.MenuItemEncryption.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEncode").Item(0);
editor.MenuItemEncryptionBase64encode.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.MenuItemEncryptionByteEncode.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.toolStripButtonAESencrypt.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.mtsBase64encode.Text = "Base64" + nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miDecode").Item(0);
editor.MenuItemEncryptionBase64decode.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.MenuItemEncryptionByteDecode.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.toolStripButtonAESdecrypt.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
editor.mtsBase64decode.Text = "Base64" + nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miLanguage").Item(0);
editor.MenuItemLang.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("tsSearchFor").Item(0);
editor.toolStripLabelSearchFor.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("tsSearch").Item(0);
editor.toolStripButtonSearch.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("tsSearchMathCase").Item(0);
editor.toolStripSearchBigSmallYes.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("labelPassphrase").Item(0);
editor.toolStripLabelAesEnc.Text = "AES " + nodeText.Attributes.GetNamedItem("string").Value.ToString() + ": ";
nodeText = xFile.GetElementsByTagName("msgRestoreBackup").Item(0);
editor.msgRestoreBackup = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("msgNotSaved").Item(0);
editor.msgNotSaved = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("msgSaveQuestion").Item(0);
editor.msgSaveQuestion = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("labelSave").Item(0);
editor.labelSave = nodeText.Attributes.GetNamedItem("string").Value.ToString();
//nodeText = xFile.GetElementsByTagName("jsErrorMsg").Item(0);
//CustomEncryptionScripts.jsErrorMsg = nodeText.Attributes.GetNamedItem("string").Value.ToString();
}
catch
{
}
}
internal void changeLangCtxtProperties(string langName)
{
XmlDocument xFile = new XmlDocument();
XmlNode nodeText;
try
{
xFile.Load(langName);
nodeText = xFile.GetElementsByTagName("miFileCtxtProperties").Item(0);
ctxtPropWindow.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("miEncryption").Item(0);
ctxtPropWindow.groupBoxEnc.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("labelOtherSettings").Item(0);
ctxtPropWindow.groupBoxOthers.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("labelSaveRTF").Item(0);
ctxtPropWindow.checkBoxWithRTF.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("labelPassphrase").Item(0);
ctxtPropWindow.labelPassword.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
nodeText = xFile.GetElementsByTagName("labelSavePassword").Item(0);
ctxtPropWindow.checkBoxSavePassInFile.Text = nodeText.Attributes.GetNamedItem("string").Value.ToString();
}
finally
{
}
}
}
}