Пример #1
0
 protected override void OnStop()
 {
     if (this.kernel != null)
     {
         this.kernel.Dispose();
         this.kernel = null;
     }
 }
Пример #2
0
        /// <summary>
        /// Called when [start].
        /// </summary>
        /// <param name="args">The args.</param>
        protected override void OnStart(string[] args)
        {
            #if DEBUGGER
            Debugger.Launch();
            #endif

            try
            {
                this.kernel = new Kernel(GraphiteConfiguration.Instance, GraphiteSystemConfiguration.Instance);
            }
            catch (Exception exception)
            {
                this.applicationEventLog.WriteEntry(exception.ToString(), EventLogEntryType.Error);

                // Don't start, if initialization wasn't successfull.
                throw;
            }
        }