Example #1
0
 /// <summary>Deletes a task from the folder.</summary>
 /// <param name="name">
 /// The name of the task that is specified when the task was registered. The '.' character cannot be used to specify the current task folder and the '..'
 /// characters cannot be used to specify the parent task folder in the path.
 /// </param>
 /// <param name="exceptionOnNotExists">Set this value to false to avoid having an exception called if the task does not exist.</param>
 public void DeleteTask([NotNull] string name, bool exceptionOnNotExists = true)
 {
     try
     {
         if (v2Folder != null)
         {
             v2Folder.DeleteTask(name, 0);
         }
         else
         {
             if (!name.EndsWith(".job", StringComparison.CurrentCultureIgnoreCase))
             {
                 name += ".job";
             }
             v1List.Delete(name);
         }
     }
     catch (FileNotFoundException)
     {
         if (exceptionOnNotExists)
         {
             throw;
         }
     }
 }
Example #2
0
 /// <summary>
 /// Deletes the task of the given <paramref name="name" />.
 /// </summary>
 /// <remarks>If you delete a task that is open, a subsequent save will throw an
 /// exception.  You can save to a filename, however, to create a new task.</remarks>
 /// <param name="name">Name of task to delete.</param>
 /// <returns>True if the task was deleted, false if the task wasn'task found.</returns>
 public bool DeleteTask(string name)
 {
     try {
         its.Delete(name);
         return(true);
     }
     catch {
         return(false);
     }
 }
Example #3
0
 /// <summary>
 ///     Deletes a task from the folder.
 /// </summary>
 /// <param name="Name"> The name of the task that is specified when the task was registered. The '.' character cannot be used to specify the current task folder and the '..' characters cannot be used to specify the parent task folder in the path. </param>
 public void DeleteTask(string Name)
 {
     if (v2Folder != null)
     {
         v2Folder.DeleteTask(Name, 0);
     }
     else
     {
         if (!Name.EndsWith(".job", StringComparison.CurrentCultureIgnoreCase))
         {
             Name += ".job";
         }
         v1List.Delete(Name);
     }
 }