예제 #1
0
        /// <summary>
        /// 获取单例对象的方法
        /// </summary>
        /// <returns></returns>
        public static ActivityMonitor GetMonitor()
        {
            if (uniqueMonitor != null)
            {
                return(uniqueMonitor);
            }

            lock (locker)
            {
                uniqueMonitor = new ActivityMonitor();
            }
            return(uniqueMonitor);
        }
예제 #2
0
 /// <summary>
 /// 释放单例对象
 /// </summary>
 public static void Dispose()
 {
     uniqueMonitor = null;
 }