Skip to content

Commit

Permalink
Lint whole codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxify52 committed Oct 4, 2023
1 parent 201cc4a commit 4e3a53e
Show file tree
Hide file tree
Showing 33 changed files with 11,862 additions and 11,619 deletions.
744 changes: 372 additions & 372 deletions GlobalMessages.cs

Large diffs are not rendered by default.

152 changes: 76 additions & 76 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,86 +6,86 @@

namespace ViPER4WindowsBin
{
internal static class Program
{
[STAThread]
private static void Main(string[] szArgs)
internal static class Program
{
if (Program.RunningInstance() != null)
return;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
string szLanguagePath = "";
string szLanguageFile = "";
string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
if (!baseDirectory.EndsWith("\\"))
baseDirectory += "\\";
string szFolder = baseDirectory + "Language\\";
string str1 = new ConfigFile(baseDirectory + "Config.ini").ReadConfig("$LANGUAGE_NAME");
if (str1 == "")
str1 = "English";
string[] strArray = new FolderExplorer().ListFiles(szFolder);
string str2 = "";
foreach (string szConfigPath in strArray)
{
if (new ConfigFile(szConfigPath).ReadConfig("$LANGUAGE_NAME").Trim() == str1)
[STAThread]
private static void Main(string[] szArgs)
{
str2 = szConfigPath;
break;
if (RunningInstance() != null)
return;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
string szLanguagePath = "";
string szLanguageFile = "";
string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
if (!baseDirectory.EndsWith("\\"))
baseDirectory += "\\";
string szFolder = baseDirectory + "Language\\";
string str1 = new ConfigFile(baseDirectory + "Config.ini").ReadConfig("$LANGUAGE_NAME");
if (str1 == "")
str1 = "English";
string[] strArray = new FolderExplorer().ListFiles(szFolder);
string str2 = "";
foreach (string szConfigPath in strArray)
{
if (new ConfigFile(szConfigPath).ReadConfig("$LANGUAGE_NAME").Trim() == str1)
{
str2 = szConfigPath;
break;
}
}
if (str2 != "")
{
szLanguagePath = szFolder;
szLanguageFile = str2;
}
else if (str1 == "English")
{
_ = (int)MessageBox.Show("Can not load default language (English), use built-in language.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
{
string str3 = "English";
foreach (string szConfigPath in strArray)
{
if (new ConfigFile(szConfigPath).ReadConfig("$LANGUAGE_NAME").Trim() == str3)
{
str2 = szConfigPath;
break;
}
}
if (str2 != "")
{
szLanguagePath = szFolder;
szLanguageFile = str2;
}
else
{
_ = (int)MessageBox.Show("Can not load default language (English), use built-in language.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
}
if (szLanguagePath != "" && szLanguageFile != "")
GlobalMessages.LoadMessages(szLanguageFile);
if (!RegHelper.CheckConfigRegister())
{
_ = (int)MessageBox.Show(GlobalMessages.DRIVER_NOT_CONFIG, GlobalMessages.ERROR, MessageBoxButtons.OK, MessageBoxIcon.Hand);
}
else
{
FrmMain.SetLanguage(szLanguagePath, szLanguageFile);
Application.Run(new FrmMain(szArgs));
}
}
}
if (str2 != "")
{
szLanguagePath = szFolder;
szLanguageFile = str2;
}
else if (str1 == "English")
{
int num1 = (int) MessageBox.Show("Can not load default language (English), use built-in language.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
{
string str3 = "English";
foreach (string szConfigPath in strArray)
{
if (new ConfigFile(szConfigPath).ReadConfig("$LANGUAGE_NAME").Trim() == str3)
{
str2 = szConfigPath;
break;
}
}
if (str2 != "")
{
szLanguagePath = szFolder;
szLanguageFile = str2;
}
else

private static Process RunningInstance()
{
int num2 = (int) MessageBox.Show("Can not load default language (English), use built-in language.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
Process currentProcess = Process.GetCurrentProcess();
foreach (Process process in Process.GetProcessesByName(currentProcess.ProcessName))
{
if (process.Id != currentProcess.Id && Assembly.GetExecutingAssembly().Location.Replace("/", "\\") == currentProcess.MainModule.FileName)
return process;
}
return null;
}
}
if (szLanguagePath != "" && szLanguageFile != "")
GlobalMessages.LoadMessages(szLanguageFile);
if (!RegHelper.CheckConfigRegister())
{
int num3 = (int) MessageBox.Show(GlobalMessages.DRIVER_NOT_CONFIG, GlobalMessages.ERROR, MessageBoxButtons.OK, MessageBoxIcon.Hand);
}
else
{
frmMain.SetLanguage(szLanguagePath, szLanguageFile);
Application.Run((Form) new frmMain(szArgs));
}
}

private static Process RunningInstance()
{
Process currentProcess = Process.GetCurrentProcess();
foreach (Process process in Process.GetProcessesByName(currentProcess.ProcessName))
{
if (process.Id != currentProcess.Id && Assembly.GetExecutingAssembly().Location.Replace("/", "\\") == currentProcess.MainModule.FileName)
return process;
}
return (Process) null;
}
}
}
Loading

0 comments on commit 4e3a53e

Please sign in to comment.