Click here to Skip to main content
15,886,422 members
Articles / Programming Languages / C#

Issues faced while extending IE with Band Objects using .NET and Windows Forms

Rate me:
Please Sign up or sign in to vote.
4.93/5 (22 votes)
13 Aug 20079 min read 161.2K   1.3K   96  
Issues faced while extending IE with Band Objects using .NET and Windows Forms
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using log4net;
using log4net.Config;
using System.Reflection;

namespace SearchBar
{
    /// <summary>
    /// This class is used for logging application info and errors.
    /// </summary>
    public sealed class Logger
    {
        #region Ctor(s)
        static Logger()
        {
            Assembly executingAssembly = Assembly.GetExecutingAssembly();
            string filePath = Path.GetDirectoryName(executingAssembly.Location);
            string asmName = Path.GetFileName(executingAssembly.Location);
            string configFileName = Path.Combine(filePath, asmName + ".config");
            System.Diagnostics.Debug.WriteLine("SearchBar configuration file path." + configFileName);
            XmlConfigurator.Configure(new FileInfo(configFileName));
        }

        #endregion

        #region Public Methods
       /// <summary>
        /// The name of the logger to get, usually this
        /// will be the type name
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public static ILog GetLogger(string name)
        {
            ILog log = LogManager.GetLogger(name);
            return log;
        }
    
        /// <summary>
        /// Get a logger based on the type name, the type name is used
        /// to infer the name of the logger
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static ILog GetLogger(Type type)
        {
            ILog log = LogManager.GetLogger(type);
            return log;
        }
        #endregion
    }

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Technical Lead
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions