예제 #1
0
        private void ExecuteCommandSet(CommandSet commandSet, object project, Package packageToTest, DtsContainer taskHost)
        {
            if (commandSet == null)
            {
                throw new ArgumentNullException("commandSet");
            }

            if (packageToTest == null)
            {
                throw new ArgumentNullException("packageToTest");
            }

            if (taskHost == null)
            {
                throw new ArgumentNullException("taskHost");
            }

            try
            {
                commandSet.CommandStarted   += CommandOnCommandStarted;
                commandSet.CommandCompleted += CommandOnCommandCompleted;
                commandSet.CommandFailed    += CommandOnCommandFailed;

                commandSet.Execute(project, packageToTest, taskHost);
            }
            finally
            {
                commandSet.CommandStarted   -= CommandOnCommandStarted;
                commandSet.CommandCompleted -= CommandOnCommandCompleted;
                commandSet.CommandFailed    -= CommandOnCommandFailed;
            }
        }
예제 #2
0
        private void ExecuteCommandSet(CommandSet commandSet)
        {
            if (commandSet == null)
            {
                throw new ArgumentNullException("commandSet");
            }

            try
            {
                commandSet.CommandStarted   += OnRaiseCommandStarted;
                commandSet.CommandCompleted += OnRaiseCommandCompleted;
                commandSet.CommandFailed    += OnRaiseCommandFailed;

                commandSet.Execute();
            }
            finally
            {
                commandSet.CommandStarted   -= OnRaiseCommandStarted;
                commandSet.CommandCompleted -= OnRaiseCommandCompleted;
                commandSet.CommandFailed    -= OnRaiseCommandFailed;
            }
        }