コード例 #1
0
		/// <summary>
		/// Initialise all the components.
		/// </summary>
		public CrashReporterReceiverServicer()
		{
			InitializeComponent();

			var StartupPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			Log = new CrashReportCommon.LogWriter( "CrashReportReceiver", Path.Combine( StartupPath, "Logs" ) );
		}
コード例 #2
0
        /// <summary>
        /// Initialise all the components.
        /// </summary>
        public CrashReporterReceiverServicer()
        {
            InitializeComponent();

            var StartupPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            Log = new CrashReportCommon.LogWriter("CrashReportReceiver", Path.Combine(StartupPath, "Logs"));
        }
コード例 #3
0
        /// <summary>
        /// Start the service, and stop the service if there were any errors found.
        /// </summary>
        /// <param name="Arguments">Command line arguments (unused).</param>
        protected override void OnStart(string[] Arguments)
        {
            // Create a log file for any start-up messages
            Log = new CrashReportCommon.LogWriter("CrashReportProcess", LogFolder);

            // Add directory watchers
            Watcher = new ReportWatcher();

            Processor = new ReportProcessor(Watcher);

            WriteEvent("Successfully started at " + DateTime.Now.ToString());
        }
コード例 #4
0
        /// <summary>
        /// Stop the service.
        /// </summary>
        protected override void OnStop()
        {
            // Clean up the directory watcher and crash processor threads
            Processor.Dispose();
            Processor = null;

            Watcher.Dispose();
            Watcher = null;

            // Flush the log to disk
            Log.Dispose();
            Log = null;
        }
コード例 #5
0
        /// <summary>
        /// Constructor: set up a landing zone directory
        /// </summary>
        /// <param name="DirectoryToUse">Directory to store the WER sub-directories</param>
        /// <param name="Log">Optional file to write messages to</param>
        public LandingZoneMonitor(string DirectoryToUse, CrashReportCommon.LogWriter Log)
        {
            Directory = DirectoryToUse;
            LogFile   = Log;

            DirectoryInfo DirInfo = new DirectoryInfo(Directory);

            if (DirInfo.Exists)
            {
                ReadMemorizedReceivedReports();
                MemorizeReceivedReports();
            }
            else
            {
                DirInfo.Create();
            }

            LogFile.Print("Landing zone: " + DirectoryToUse);
        }