Пример #1
0
 static LogFactory()
 {
   try
   {
     ReferencingAssembly = GetReferencingAssembly();
     AbstractConfigurator Configurator = new ConfigFileConfigurator();        
     if (ReferencingAssembly != null)
     {
       object[] Attribs = ReferencingAssembly.GetCustomAttributes(typeof(ConfiguratorAttribute), false);
       if (Attribs != null)
       {
         if (Attribs.Length == 1)
         {
           if (Attribs[0] is ConfiguratorAttribute)
           {
             Configurator = ((ConfiguratorAttribute)Attribs[0]).Configurator;
           }
         }
       }
     }
     Categories = Configurator.GetCategories(ref DefaultName);                
   }
   finally
   {
   }
   if (DefaultName == null)
   {
     if (Categories.Count > 0)
     {
       DefaultName = (string)Categories.GetKey(0);
     }
     else
     {
       Category Temp = new Category();
       Temp.Name = "Default";
       Temp.Initialize();
       Categories.Add("Default", Temp);
       DefaultName = "Default";
     }
   }
 }
Пример #2
0
 static LogFactory()
 {
     try
     {
         ReferencingAssembly = GetReferencingAssembly();
         AbstractConfigurator Configurator = new ConfigFileConfigurator();
         if (ReferencingAssembly != null)
         {
             object[] Attribs = ReferencingAssembly.GetCustomAttributes(typeof(ConfiguratorAttribute), false);
             if (Attribs != null)
             {
                 if (Attribs.Length == 1)
                 {
                     if (Attribs[0] is ConfiguratorAttribute)
                     {
                         Configurator = ((ConfiguratorAttribute)Attribs[0]).Configurator;
                     }
                 }
             }
         }
         Categories = Configurator.GetCategories(ref DefaultName);
     }
     finally
     {
     }
     if (DefaultName == null)
     {
         if (Categories.Count > 0)
         {
             DefaultName = (string)Categories.GetKey(0);
         }
         else
         {
             Category Temp = new Category();
             Temp.Name = "Default";
             Temp.Initialize();
             Categories.Add("Default", Temp);
             DefaultName = "Default";
         }
     }
 }