Single Instance app changes.

This commit is contained in:
Patrick Fic
2021-04-13 11:10:20 -07:00
parent 05156b6d21
commit 81f77ea59f
3 changed files with 18 additions and 2 deletions

7
.gitignore vendored
View File

@@ -10,6 +10,7 @@
*.userosscache *.userosscache
*.sln.docstates *.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio) # User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs *.userprefs
@@ -345,4 +346,8 @@ healthchecksdb
!**/Releases/ !**/Releases/
!**/Releases/* !**/Releases/*
!**/Releases/**/* !**/Releases/**/*
*.exe
*.nupkg
*.msi

View File

@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Configuration; using System.Configuration;
using System.Data; using System.Data;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
@@ -18,6 +19,16 @@ namespace BodyshopPartner
{ {
//System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("es-MX"); //System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("es-MX");
//System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fr-CA"); //System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fr-CA");
Process proc = Process.GetCurrentProcess();
int count = Process.GetProcesses().Where(p =>
p.ProcessName == proc.ProcessName).Count();
if (count > 1)
{
MessageBox.Show("ImEX Online Partner is already running.");
App.Current.Shutdown();
}
} }
private void Application_Exit(object sender, ExitEventArgs e) private void Application_Exit(object sender, ExitEventArgs e)

View File

@@ -51,7 +51,7 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.13.0")] [assembly: AssemblyVersion("1.0.14.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
//Setting Squirrel Aware Version. //Setting Squirrel Aware Version.
[assembly: AssemblyMetadata("SquirrelAwareVersion", "1")] [assembly: AssemblyMetadata("SquirrelAwareVersion", "1")]