Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="logMode"></param>
        /// <returns></returns>
        public static ILoggingAdapter GetObject(string logMode)
        {
            try
            {
                if (ExtensionMethods.IsInDesignMode())
                {
                    return(new DesignTimeAdapter());
                }

                if (logMode == "XML")
                {
                    return(new XMLLogAdapter());
                }
                else if (logMode == "DB")
                {
                    return(new DBLogAdapter());
                }
                else if (logMode == "EVENTLOG")
                {
                    return(new EventLogAdapter());
                }
                else
                {
                    return(TextLogAdapter.GetInstance());
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
 public static TextLogAdapter GetInstance()
 {
     if (textLogAdapter == null)
     {
         lock (lockObject)
         {
             if (textLogAdapter == null)
                 textLogAdapter = new TextLogAdapter();
         }
     }
     return textLogAdapter;
 }
Ejemplo n.º 3
0
 public static TextLogAdapter GetInstance()
 {
     if (textLogAdapter == null)
     {
         lock (lockObject)
         {
             if (textLogAdapter == null)
             {
                 textLogAdapter = new TextLogAdapter();
             }
         }
     }
     return(textLogAdapter);
 }