示例#1
0
 private static int ExecuteOption(AbstractOptions options)
 {
     try
     {
         options.Execute();
         return(0);
     }
     catch (OperationFailedGracefully)
     {
         Console.WriteLine("Operation failed.");
         //nothing to do — failed gracefully already.
         return(-1);
     }
 }
示例#2
0
		private static int ExecuteOption(AbstractOptions options)
		{
			try
			{
				options.Execute();
				return 0;
			}
			catch (OperationFailedGracefully)
			{
				Console.WriteLine("Operation failed.");
				//nothing to do — failed gracefully already.
				return -1;
			}
		}