public ResultTask(string name, string description, int delayAfterCompletion, TaskHelper.TaskType type, DateTime firstConnectionStartTime)
 {
     Name                     = name;
     Description              = description;
     Type                     = type;
     DelayAfterCompletion     = delayAfterCompletion;
     FirstConnectionStartTime = firstConnectionStartTime;
 }
Example #2
0
 public Task(string name, string description, int delayAfterCompletion, string sql, TaskHelper.TaskType type, bool enabled, bool includeInResults)
 {
     Name                 = name;
     Description          = description;
     DelayAfterCompletion = delayAfterCompletion;
     Sql              = sql;
     Type             = type;
     Enabled          = enabled;
     IncludeInResults = includeInResults;
 }
Example #3
0
    private bool DoesFirstConnectionStartTimesAlreadyHaveThisTaskType(TaskHelper.TaskType taskType)
    {
        foreach (FirstConnectionStartTimeObject firstConnectionStartTime in _firstConnectionStartTimes)
        {
            if (firstConnectionStartTime.TaskType == taskType)
            {
                return(true);
            }
        }

        return(false);
    }
Example #4
0
    private void ParseTaskNode(XmlNode node)
    {
        string taskName             = node.Attributes["name"].Value;
        string description          = node.Attributes["description"].Value;
        int    delayAfterCompletion = Convert.ToInt32(node.Attributes["delayAfterCompletion"].Value);

        TaskHelper.TaskType type = TaskHelper.StringToTaskType(node.Attributes["type"].Value);
        DateTime            firstConnectionStartTime = Convert.ToDateTime(node.Attributes["firstConnectionStartTime"].Value);

        HandleTaskNode(taskName, description, delayAfterCompletion, type, firstConnectionStartTime);

        XmlNode dataNode = node.SelectSingleNode("data");

        ParseDataNode(dataNode, taskName);
    }
Example #5
0
    private int GetConnectionsStartTime(DateTime startTime, string taskName)
    {
        TaskHelper.TaskType taskType = new TaskHelper.TaskType();

        foreach (Task task in TaskHelper.TaskCollection.Tasks)
        {
            if (task.Name == taskName)
            {
                taskType = task.Type;
            }
        }

        foreach (FirstConnectionStartTimeObject firstConnectionStartTime in _firstConnectionStartTimes)
        {
            if (firstConnectionStartTime.TaskType == taskType)
            {
                return(Convert.ToInt32(startTime.Subtract(firstConnectionStartTime.FirstConnectionStartTime).TotalMilliseconds));
            }
        }

        return(0);
    }
Example #6
0
 private void HandleTaskNode(string taskName, string description, int delayAfterCompletion, TaskHelper.TaskType type, DateTime firstConnectionStartTime)
 {
     _resultTaskCollection.Tasks.Add(new ResultTask(taskName, description, delayAfterCompletion, type, firstConnectionStartTime));
 }
Example #7
0
 public FirstConnectionStartTimeObject(DateTime firstConnectionStartTime, TaskHelper.TaskType taskType)
 {
     FirstConnectionStartTime = firstConnectionStartTime;
     TaskType = taskType;
 }