示例#1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="uniqueName"></param>
        /// <returns>True is another instance is already running. False otherwise</returns>
        public static Boolean CheckForOtherApp(String uniqueName)
        {
            SingleAppComEventName = uniqueName;
              try
              {
            // another instance is already running
            threadComEvent = EventWaitHandle.OpenExisting(SingleAppComEventName);
            threadComEvent.Set();  // signal the other instance.
            threadComEvent.Close();
            return true;    // return immediatly.
              }
              catch { /* don't care about errors */     }
              // Create the Event handle
              threadComEvent = new EventWaitHandle(false, EventResetMode.AutoReset, SingleAppComEventName);
              // make sure the resources are cleaned up afterwards.
              cleanupCode = new CleanupCode();
              CreateInterAppComThread();

              return false;
        }
示例#2
0
 public static extern void ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData);
示例#3
0
 public static void ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
 {
 }
示例#4
0
 public static extern void ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, object?userData);