public void OnCommit(object taskHost)
        {
            TaskHost host = taskHost as TaskHost;

            if (host == null)
            {
                throw new ArgumentException("Arugment is not a TaskHost.", "taskHost");
            }

            WaitTaskMain task = host.InnerObject as WaitTaskMain;

            if (task == null)
            {
                throw new ArgumentException("Arugment is not a A.LE WaitTask.", "taskHost");
            }

            host.Name        = generalNode.Name;
            host.Description = generalNode.Description;

            // Task properties
            task.WaitUntilTimeInternal           = generalNode.WaitUntilTimeInternal;
            task.SleepTimeInMinutes              = generalNode.SleepTimeInMinutes;
            task.DoNothingAndContinue            = generalNode.DoNothingAndContinue;
            task.SQLRepetitionFrequencyInMinutes = generalNode.SQLRepetitionFrequencyInMinutes;
            task.SQLCheckStatement  = generalNode.SQLCheckStatement;
            task.SQLConnectionID    = generalNode.SQLConnectionID;
            task.MaximumSQLWaitTime = generalNode.MaximumSQLWaitTime;
        }
Exemple #2
0
        internal GeneralViewNode(TaskHost taskHost, IDtsConnectionService connectionService)
        {
            this.taskHost          = taskHost;
            this.connectionService = connectionService;

            // Extract common values from the Task Host
            name        = taskHost.Name;
            description = taskHost.Description;

            // Extract values from the task object
            WaitTaskMain task = taskHost.InnerObject as WaitTaskMain;

            if (task == null)
            {
                throw new ArgumentException("Type mismatch for taskHost inner object.");
            }

            AvailableConnections = LoadDBConnections();

            WaitUntilTimeInternal           = task.WaitUntilTimeInternal;
            SleepTimeInMinutes              = task.SleepTimeInMinutes;
            DoNothingAndContinue            = task.DoNothingAndContinue;
            SQLRepetitionFrequencyInMinutes = task.SQLRepetitionFrequencyInMinutes;
            SQLCheckStatement = task.SQLCheckStatement;

            SQLConnectionID = task.SQLConnectionID;
            var connection = GetConnectionById(task.SQLConnectionID);

            if (connection != null)
            {
                _sqlConnection = connection.Name;
            }

            MaximumSQLWaitTime = task.MaximumSQLWaitTime;
        }