Exemplo n.º 1
0
        public void ExecuteStartedHandler()
        {
            if (StartHandlerHasExecuted)
            {
                return;
            }

            if (EventArgs is ProjectStartedEventArgs)
            {
                ConsoleLogger.ProjectStartedHandler(null, (ProjectStartedEventArgs)EventArgs);
            }
            else if (EventArgs is TargetStartedEventArgs)
            {
                ConsoleLogger.TargetStartedHandler(null, (TargetStartedEventArgs)EventArgs);
            }
            else if (EventArgs is TaskStartedEventArgs)
            {
                ConsoleLogger.TaskStartedHandler(null, (TaskStartedEventArgs)EventArgs);
            }
            else if (!(EventArgs is BuildStartedEventArgs))
            {
                throw new InvalidOperationException("Unexpected event on the stack, type: " + EventArgs.GetType());
            }

            StartHandlerHasExecuted = true;
        }