Ejemplo n.º 1
0
        /// <summary>
        /// Add an event to the queue, and notify any listeners.
        /// </summary>
        /// <param name="oArgs"></param>
        /// <returns></returns>
        public static bool AddEvent(StatusArgs oArgs)
        {
            String fn = MethodBase.GetCurrentMethod().Name;

            try
            {
                lock (Events)
                {
                    Events.Add(oArgs);
                    if (null != EventLogChanged)
                    {
                        EventLogChanged();
                    }

                    Console.WriteLine();
                    Console.WriteLine(DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString() + DateTime.Now.Millisecond
                                      + " " + oArgs.Severity.ToString());
                    Console.WriteLine("  Context: " + oArgs.Context);
                    Console.WriteLine("  Subject: " + oArgs.Source.ToString());
                    Console.WriteLine("  Message: " + oArgs.Message);
                } // end lock(Events)
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        public static bool AddEvent(object oSrc, Sev qSev, object oContext, string sMessage)
        {
            string scontext = "";

            if (null != oContext)
            {
                scontext = oContext.ToString();
            }
            StatusArgs args = new StatusArgs(oSrc, qSev, scontext, sMessage);

            return(AddEvent(args));
        }
Ejemplo n.º 3
0
 public StatusCounter(StatusArgs oStatus, int iCount)
 {
     Count = iCount;
     Status = oStatus;
 }