public Boolean Start(SingleInstanceScope scope) { Boolean firstInstance = false; String singleInstanceName; //Local limits instance to one per logged in user //Global limits scope to 1 across all user sessions singleInstanceName = String.Format("{0}\\{1}", scope == SingleInstanceScope.CurrentUser ? "Local" : "Global", AssemblyIdentifier()); //Create mutex and get whether this is first instance mutex = new Mutex(true, singleInstanceName, out firstInstance); //Return whether this is first instance return firstInstance; }
public Boolean Start(SingleInstanceScope scope) { Boolean firstInstance = false; String singleInstanceName; //Local limits instance to one per logged in user //Global limits scope to 1 across all user sessions singleInstanceName = String.Format("{0}\\{1}", scope == SingleInstanceScope.CurrentUser ? "Local" : "Global", AssemblyIdentifier()); //Create mutex and get whether this is first instance mutex = new Mutex(true, singleInstanceName, out firstInstance); //Return whether this is first instance return(firstInstance); }