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