public static void ThrowOnError(this InstallationProxyError value, string message)
 {
     if ((value != InstallationProxyError.Success))
     {
         throw new InstallationProxyException(value, message);
     }
 }
Example #2
0
        public static InstallationProxyError instproxy_lookup(InstallationProxyClientHandle client, System.Collections.ObjectModel.ReadOnlyCollection <string> appids, PlistHandle clientOptions, out PlistHandle result)
        {
            System.Runtime.InteropServices.ICustomMarshaler appidsMarshaler = NativeStringArrayMarshaler.GetInstance(null);
            System.IntPtr          appidsNative = appidsMarshaler.MarshalManagedToNative(appids);
            InstallationProxyError returnValue  = InstallationProxyNativeMethods.instproxy_lookup(client, appidsNative, clientOptions, out result);

            return(returnValue);
        }
Example #3
0
        public static InstallationProxyError instproxy_client_get_path_for_bundle_identifier(InstallationProxyClientHandle client, string bundleId, out string path)
        {
            System.Runtime.InteropServices.ICustomMarshaler pathMarshaler = NativeStringMarshaler.GetInstance(null);
            System.IntPtr          pathNative  = System.IntPtr.Zero;
            InstallationProxyError returnValue = InstallationProxyNativeMethods.instproxy_client_get_path_for_bundle_identifier(client, bundleId, out pathNative);

            path = ((string)pathMarshaler.MarshalNativeToManaged(pathNative));
            pathMarshaler.CleanUpNativeData(pathNative);
            return(returnValue);
        }
Example #4
0
        public static InstallationProxyError instproxy_check_capabilities_match(InstallationProxyClientHandle client, out string capabilities, PlistHandle clientOptions, out PlistHandle result)
        {
            System.Runtime.InteropServices.ICustomMarshaler capabilitiesMarshaler = NativeStringMarshaler.GetInstance(null);
            System.IntPtr          capabilitiesNative = System.IntPtr.Zero;
            InstallationProxyError returnValue        = InstallationProxyNativeMethods.instproxy_check_capabilities_match(client, out capabilitiesNative, clientOptions, out result);

            capabilities = ((string)capabilitiesMarshaler.MarshalNativeToManaged(capabilitiesNative));
            capabilitiesMarshaler.CleanUpNativeData(capabilitiesNative);
            return(returnValue);
        }
Example #5
0
        public static InstallationProxyError instproxy_status_get_error(PlistHandle status, out string name, out string description, ref ulong code)
        {
            System.Runtime.InteropServices.ICustomMarshaler descriptionMarshaler = NativeStringMarshaler.GetInstance(null);
            System.IntPtr descriptionNative = System.IntPtr.Zero;
            System.Runtime.InteropServices.ICustomMarshaler nameMarshaler = NativeStringMarshaler.GetInstance(null);
            System.IntPtr          nameNative  = System.IntPtr.Zero;
            InstallationProxyError returnValue = InstallationProxyNativeMethods.instproxy_status_get_error(status, out nameNative, out descriptionNative, ref code);

            name = ((string)nameMarshaler.MarshalNativeToManaged(nameNative));
            nameMarshaler.CleanUpNativeData(nameNative);
            description = ((string)descriptionMarshaler.MarshalNativeToManaged(descriptionNative));
            descriptionMarshaler.CleanUpNativeData(descriptionNative);
            return(returnValue);
        }
 public static bool IsError(this InstallationProxyError value)
 {
     return(value != InstallationProxyError.Success);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="InstallationProxyException"/> 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 InstallationProxyException(InstallationProxyError error, string message) :
     base(string.Format("An InstallationProxy error occurred. {1}. The error code was {0}", error, message))
 {
     this.errorCode = error;
 }