Esempio n. 1
0
 public static void ThrowOnError(this RestoreError value, string message)
 {
     if ((value != RestoreError.Success))
     {
         throw new RestoreException(value, message);
     }
 }
        public static RestoreError restored_query_type(RestoreClientHandle client, out string type, ref ulong version)
        {
            System.Runtime.InteropServices.ICustomMarshaler typeMarshaler = NativeStringMarshaler.GetInstance(null);
            System.IntPtr typeNative  = System.IntPtr.Zero;
            RestoreError  returnValue = RestoreNativeMethods.restored_query_type(client, out typeNative, ref version);

            type = ((string)typeMarshaler.MarshalNativeToManaged(typeNative));
            typeMarshaler.CleanUpNativeData(typeNative);
            return(returnValue);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="RestoreException"/> 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 RestoreException(RestoreError error, string message) : 
         base(string.Format("An Restore error occurred. {1}. The error code was {0}", error, message))
 {
     this.errorCode = error;
 }
Esempio n. 4
0
 public static bool IsError(this RestoreError value)
 {
     return(value != RestoreError.Success);
 }