/// <summary>
 ///     Unschedules the task.
 /// </summary>
 /// <param name="task">
 /// The task.
 /// </param>
 public static void UnscheduleTask(IScheduleTask task)
 {
     lock (s_Lock)
     {
         KeyValuePair <DateTime, IScheduleTask> entry = s_PendingTasks.Where(p => p.Value == task).FirstOrDefault();
         if (!entry.IsNull())
         {
             s_PendingTasks.Remove(entry.Key);
             ProcessTasks(null);
         }
     }
 }