public static void ThrowOnError(this DebugServerError value, string message) { if ((value != DebugServerError.Success)) { throw new DebugServerException(value, message); } }
public static DebugServerError debugserver_command_new(string name, int argc, System.Collections.ObjectModel.ReadOnlyCollection <string> argv, out DebugServerCommandHandle command) { System.Runtime.InteropServices.ICustomMarshaler argvMarshaler = NativeStringArrayMarshaler.GetInstance(null); System.IntPtr argvNative = argvMarshaler.MarshalManagedToNative(argv); DebugServerError returnValue = DebugServerNativeMethods.debugserver_command_new(name, argc, argvNative, out command); return(returnValue); }
public static DebugServerError debugserver_client_set_environment_hex_encoded(DebugServerClientHandle client, string env, out string response) { System.Runtime.InteropServices.ICustomMarshaler responseMarshaler = NativeStringMarshaler.GetInstance(null); System.IntPtr responseNative = System.IntPtr.Zero; DebugServerError returnValue = DebugServerNativeMethods.debugserver_client_set_environment_hex_encoded(client, env, out responseNative); response = ((string)responseMarshaler.MarshalNativeToManaged(responseNative)); responseMarshaler.CleanUpNativeData(responseNative); return(returnValue); }
public static DebugServerError debugserver_client_receive_response(DebugServerClientHandle client, out string response, ref uint responseSize) { System.Runtime.InteropServices.ICustomMarshaler responseMarshaler = NativeStringMarshaler.GetInstance(null); System.IntPtr responseNative = System.IntPtr.Zero; DebugServerError returnValue = DebugServerNativeMethods.debugserver_client_receive_response(client, out responseNative, ref responseSize); response = ((string)responseMarshaler.MarshalNativeToManaged(responseNative)); responseMarshaler.CleanUpNativeData(responseNative); return(returnValue); }
public static DebugServerError debugserver_client_set_argv(DebugServerClientHandle client, int argc, System.Collections.ObjectModel.ReadOnlyCollection <string> argv, out string response) { System.Runtime.InteropServices.ICustomMarshaler responseMarshaler = NativeStringMarshaler.GetInstance(null); System.IntPtr responseNative = System.IntPtr.Zero; System.Runtime.InteropServices.ICustomMarshaler argvMarshaler = NativeStringArrayMarshaler.GetInstance(null); System.IntPtr argvNative = argvMarshaler.MarshalManagedToNative(argv); DebugServerError returnValue = DebugServerNativeMethods.debugserver_client_set_argv(client, argc, argvNative, out responseNative); response = ((string)responseMarshaler.MarshalNativeToManaged(responseNative)); responseMarshaler.CleanUpNativeData(responseNative); return(returnValue); }
public static bool IsError(this DebugServerError value) { return(value != DebugServerError.Success); }
/// <summary> /// Initializes a new instance of the <see cref="DebugServerException"/> 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 DebugServerException(DebugServerError error, string message) : base(string.Format("An DebugServer error occurred. {1}. The error code was {0}", error, message)) { this.errorCode = error; }