示例#1
0
        /// <summary>
        /// Validates the job definition object retrieved from store by syncing
        /// its data with the corresponding Task Scheduler task.  If no task 
        /// is found then validation fails.
        /// </summary>
        /// <param name="definition"></param>
        /// <returns></returns>
        private bool ValidateJobDefinition(ScheduledJobDefinition definition)
        {
            Exception ex = null;
            try
            {
                definition.SyncWithWTS();
            }
            catch (System.IO.DirectoryNotFoundException e)
            {
                ex = e;
            }
            catch (System.IO.FileNotFoundException e)
            {
                ex = e;
            }
            catch (System.ArgumentNullException e)
            {
                ex = e;
            }

            if (ex != null)
            {
                WriteErrorLoadingDefinition(definition.Name, ex);
            }

            return (ex == null);
        }
示例#2
0
		private bool ValidateJobDefinition(ScheduledJobDefinition definition)
		{
			Exception exception = null;
			try
			{
				definition.SyncWithWTS();
			}
			catch (DirectoryNotFoundException directoryNotFoundException1)
			{
				DirectoryNotFoundException directoryNotFoundException = directoryNotFoundException1;
				exception = directoryNotFoundException;
			}
			catch (FileNotFoundException fileNotFoundException1)
			{
				FileNotFoundException fileNotFoundException = fileNotFoundException1;
				exception = fileNotFoundException;
			}
			catch (ArgumentNullException argumentNullException1)
			{
				ArgumentNullException argumentNullException = argumentNullException1;
				exception = argumentNullException;
			}
			if (exception != null)
			{
				this.WriteErrorLoadingDefinition(definition.Name, exception);
			}
			return exception == null;
		}