示例#1
0
    protected static void InitLoggerNet(Type ClassType)
    {
#if DEBUG
      if (ClassType == null)
      {
        throw new ArgumentNullException("ClassType");
      }
      LogCategory = LogFactory.GetCategory(ClassType.FullName);
#endif 
    }
示例#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";
     }
   }
 }
示例#3
0
    /// <summary>
    ///   <para>
    ///     Creates a new instance of <see cref="BaseComponent"/>.
    ///   </para>
    /// </summary>
    public BaseComponent()
		{
#if DEBUG
      LogCategory = LogFactory.GetCategory(this.GetType().FullName);
#endif

			InitializeComponent();
		}
示例#4
0
    /// <summary>
    /// Creates a new instance of <see cref="BaseObject"/>
    /// </summary>
    public BaseMarshalByRefObject()
		{
#if DEBUG
      LogCategory = LogFactory.GetCategory(this.GetType().FullName);
#endif
		}
示例#5
0
    /// <summary>
    ///   <para>
    ///     Creates a new instance of <see cref="BaseComponent"/>.
    ///   </para>
    /// </summary>
    /// <param name="container">
    ///   <para>
    ///     The parent of this component.
    ///   </para>
    /// </param>
		public BaseComponent(System.ComponentModel.IContainer container)
		{
#if DEBUG
      LogCategory = LogFactory.GetCategory(this.GetType().FullName);
#endif

			container.Add(this);
			InitializeComponent();
		}