Пример #1
0
		/// <summary>
		/// Default constructor.
		/// </summary>
		/// <param name="log">Indicates the log item</param>
		/// <param name="source">Indicates what logged the event</param>
		/// <param name="type"></param>
		public EventLog(string log, string source, EventLogWriterType type)
		{
			string logFileName = "";
			string logPath = "";
			//Setup the file and path
			if(logFileName.Length==0)
			{
				logFileName = Assembly.GetCallingAssembly().GetName().CodeBase + ".Log";
				logFileName = logFileName.Substring(logFileName.LastIndexOf("\\")+1);
			}
			if(logPath.Length==0)
			{
				logPath = Assembly.GetCallingAssembly().GetName().CodeBase;
				logPath = Path.GetDirectoryName(logPath) + "\\";
			}

			//Load the log file
			this.eventLogWriterType = type;
			this.CreateEventLogWriter(log, source, logPath, logFileName);
		}
Пример #2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="log">Indicates the log item</param>
        /// <param name="source">Indicates what logged the event</param>
        /// <param name="type"></param>
        public EventLog(string log, string source, EventLogWriterType type)
        {
            string logFileName = "";
            string logPath     = "";

            //Setup the file and path
            if (logFileName.Length == 0)
            {
                logFileName = Assembly.GetCallingAssembly().GetName().CodeBase + ".Log";
                logFileName = logFileName.Substring(logFileName.LastIndexOf("\\") + 1);
            }
            if (logPath.Length == 0)
            {
                logPath = Assembly.GetCallingAssembly().GetName().CodeBase;
                logPath = Path.GetDirectoryName(logPath) + "\\";
            }

            //Load the log file
            this.eventLogWriterType = type;
            this.CreateEventLogWriter(log, source, logPath, logFileName);
        }
Пример #3
0
 /// <summary>
 /// Overloaded constructor
 /// </summary>
 /// <param name="log">Indicates the log item</param>
 /// <param name="source">Indicates what logged the event</param>
 /// <param name="path"></param>
 /// <param name="fileName"></param>
 /// <param name="type"></param>
 public EventLog(string log, string source, string path, string fileName, EventLogWriterType type)
 {
     //Load the log file
     this.eventLogWriterType = type;
     this.CreateEventLogWriter(log, source, path, fileName);
 }
Пример #4
0
		/// <summary>
		/// Overloaded constructor
		/// </summary>
		/// <param name="log">Indicates the log item</param>
		/// <param name="source">Indicates what logged the event</param>
		/// <param name="path"></param>
		/// <param name="fileName"></param>
		/// <param name="type"></param>
		public EventLog(string log, string source,string path, string fileName, EventLogWriterType type)
		{
			//Load the log file
			this.eventLogWriterType = type;
			this.CreateEventLogWriter(log,source,path,fileName);
		}