Ejemplo n.º 1
0
 /// <summary>
 /// 通知观察者;
 /// </summary>
 private static void NotifyNext(ConsoleEvent consoleEvent)
 {
     lock (asyncLock)
     {
         observerCollection.NotifyNextSafe(consoleEvent);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 记录成功条目;
        /// </summary>
        public static void WriteSuccessful(string message)
        {
            ConsoleEvent consoleEvent = new ConsoleEvent()
            {
                EventType = ConsoleEventType.Successful,
                Message   = message,
            };

            NotifyNext(consoleEvent);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 记录异常条目;
        /// </summary>
        public static void WriteError(string message)
        {
            ConsoleEvent consoleEvent = new ConsoleEvent()
            {
                EventType = ConsoleEventType.Error,
                Message   = message,
            };

            NotifyNext(consoleEvent);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 记录方法条目;
        /// </summary>
        public static void WriteMethod(string message)
        {
            ConsoleEvent consoleEvent = new ConsoleEvent()
            {
                EventType = ConsoleEventType.Method,
                Message   = message,
            };

            NotifyNext(consoleEvent);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 记录警告条目;
        /// </summary>
        public static void WriteWarning(string message)
        {
            ConsoleEvent consoleEvent = new ConsoleEvent()
            {
                EventType = ConsoleEventType.Warning,
                Message   = message,
            };

            NotifyNext(consoleEvent);
        }