public static void ThrowOnError(this MobileBackupError value, string message)
 {
     if ((value != MobileBackupError.Success))
     {
         throw new MobileBackupException(value, message);
     }
 }
 public static bool IsError(this MobileBackupError value)
 {
     return(value != MobileBackupError.Success);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MobileBackupException"/> class with a specified error code and error message.
 /// </summary>
 /// <param name="error">
 /// The error code of the error that occurred.
 /// </param>
 /// <param name="message">
 /// A message which describes the error.
 /// </param>
 public MobileBackupException(MobileBackupError error, string message) :
     base(string.Format("An MobileBackup error occurred. {1}. The error code was {0}", error, message))
 {
     this.errorCode = error;
 }