예제 #1
0
        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;
        }
예제 #2
0
        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);
        }