Click here to Skip to main content
12,622,747 members (31,750 online)
Click here to Skip to main content
Articles » Languages » C# » General » Downloads

Stats

122.1K views
1.2K downloads
96 bookmarked
Posted

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

, 13 Aug 2007
Issues faced while extending IE with Band Objects using .NET and Windows Forms
MyToolbar
lib
Interop.SHDocVw.dll
log4net.dll
source
BandObjectLib
BandObjects.snk
BandObjects.snk
MyToolbar.suo
SearchBar
BandObjects.snk
images
Ask.png
Google.png
MSN.png
Thumbs.db
Yahoo.png
Properties
ToolbarInstaller
ToolbarInstaller.vdproj
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

Share

About the Author

Sonal.India
Technical Lead
India India
No Biography provided

You may also be interested in...

Pro
Pro
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161128.1 | Last Updated 14 Aug 2007
Article Copyright 2007 by Sonal.India
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid