Multiple running instances of TBF program tested.
This commit is contained in:
@@ -66,6 +66,14 @@ namespace TBF
|
||||
Version = string.Format("{0}.{1}.{2}", ver.Major, ver.Minor, ver.Build);
|
||||
BuildDateTime = new System.IO.FileInfo(thisAssembly.Location).LastWriteTime;
|
||||
|
||||
/// Check if another instance is running
|
||||
string processName = System.IO.Path.GetFileNameWithoutExtension(thisAssembly.Location);
|
||||
if (System.Diagnostics.Process.GetProcessesByName(processName).Length > 1)
|
||||
{
|
||||
MessageBox.Show(Strings.Another_instance_is_running, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||
return;
|
||||
}
|
||||
|
||||
/// Local program configuration directory including the trailing backslash
|
||||
string locAppDataDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) +
|
||||
Path.DirectorySeparatorChar + "TestBenchFramework" + Path.DirectorySeparatorChar;
|
||||
|
||||
@@ -222,6 +222,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Another instance of Test Bench Framework program is running. Please, close it using Task Manager..
|
||||
/// </summary>
|
||||
internal static string Another_instance_is_running {
|
||||
get {
|
||||
return ResourceManager.GetString("Another_instance_is_running", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Approval.
|
||||
/// </summary>
|
||||
|
||||
@@ -1266,4 +1266,7 @@
|
||||
<data name="Short_dercription" xml:space="preserve">
|
||||
<value>Stručný popis</value>
|
||||
</data>
|
||||
<data name="Another_instance_is_running" xml:space="preserve">
|
||||
<value>Další instance programu Test Bench Framework je spuštěna. Uzavřete jí prosím s použitím 'Správce úloh'.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1341,4 +1341,7 @@
|
||||
<data name="Short_dercription" xml:space="preserve">
|
||||
<value>Kurzbeschreibung</value>
|
||||
</data>
|
||||
<data name="Another_instance_is_running" xml:space="preserve">
|
||||
<value>Ein weiteres Test Bench Framework Programm-Instanz ausgeführt wird. Bitte schließen Sie es dem Taskmanager.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1510,4 +1510,7 @@
|
||||
<data name="T_warm_ref" xml:space="preserve">
|
||||
<value>T hi. ref.</value>
|
||||
</data>
|
||||
<data name="Another_instance_is_running" xml:space="preserve">
|
||||
<value>Another instance of Test Bench Framework program is running. Please, close it using Task Manager.</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user