示例#1
0
 internal TaskCollection(TaskFolder folder, V2Interop.IRegisteredTaskCollection iTaskColl, Regex filter = null)
 {
     this.svc    = folder.TaskService;
     this.Filter = filter;
     fld         = folder;
     v2Coll      = iTaskColl;
 }
        /// <summary>
        /// Finds the task in folder.
        /// </summary>
        /// <param name="fld">The folder.</param>
        /// <param name="taskName">The wildcard expression to compare task names with.</param>
        /// <param name="recurse">if set to <c>true</c> recurse folders.</param>
        /// <returns>A <see cref="Task"/> if one matches <paramref name="taskName"/>, otherwise NULL.</returns>
        private Task FindTaskInFolder(TaskFolder fld, System.Text.RegularExpressions.Regex taskName, bool recurse = true)
        {
            foreach (var t in fld.GetTasks(taskName))
            {
                return(t);
            }

            if (recurse)
            {
                Task task = null;
                foreach (var f in fld.SubFolders)
                {
                    if ((task = FindTaskInFolder(f, taskName, recurse)) != null)
                    {
                        return(task);
                    }
                }
            }
            return(null);
        }
示例#3
0
 internal V2TaskEnumerator(TaskFolder folder, TaskScheduler.V2Interop.IRegisteredTaskCollection iTaskColl, Regex filter = null)
 {
     this.fld    = folder;
     this.iEnum  = iTaskColl.GetEnumerator();
     this.filter = filter;
 }