Ejemplo n.º 1
0
 protected override void OnCustomCommand(int command)
 {
     using (var eventLog = new TaskManagementEventLog())
     {
         try
         {
             Trace.WriteLineIf(Tracing.Is.TraceVerbose, "command={0}".FormatWith(command));
             throw new NotSupportedException(string.Format(
                                                 Thread.CurrentThread.CurrentUICulture,
                                                 Resources.TaskManagementService_UnsupportedCustomCommand,
                                                 command));
         }
         catch (Exception exception)
         {
             eventLog.FailureOnContinue();
             Trace.TraceError("{0}", exception);
         }
     }
 }
Ejemplo n.º 2
0
        protected override void OnContinue()
        {
            using (var eventLog = new TaskManagementEventLog())
            {
                try
                {
                    Trace.WriteLineIf(Tracing.Is.TraceVerbose, string.Empty);
                    if (null == Manager)
                    {
                        throw new InvalidOperationException();
                    }

                    Manager.Continue();
                    eventLog.SuccessOnContinue();
                }
                catch (Exception exception)
                {
                    eventLog.FailureOnContinue();
                    Trace.TraceError("{0}", exception);
                }
            }
        }