Пример #1
0
 public static void ThrowOnError(this NotificationProxyError value, string message)
 {
     if ((value != NotificationProxyError.Success))
     {
         throw new NotificationProxyException(value, message);
     }
 }
        public static NotificationProxyError np_observe_notifications(NotificationProxyClientHandle client, out string notificationSpec)
        {
            System.Runtime.InteropServices.ICustomMarshaler notificationSpecMarshaler = NativeStringMarshaler.GetInstance(null);
            System.IntPtr          notificationSpecNative = System.IntPtr.Zero;
            NotificationProxyError returnValue            = NotificationProxyNativeMethods.np_observe_notifications(client, out notificationSpecNative);

            notificationSpec = ((string)notificationSpecMarshaler.MarshalNativeToManaged(notificationSpecNative));
            notificationSpecMarshaler.CleanUpNativeData(notificationSpecNative);
            return(returnValue);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="NotificationProxyException"/> 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 NotificationProxyException(NotificationProxyError error, string message) :
     base(string.Format("An NotificationProxy error occurred. {1}. The error code was {0}", error, message))
 {
     this.errorCode = error;
 }
Пример #4
0
 public static bool IsError(this NotificationProxyError value)
 {
     return(value != NotificationProxyError.Success);
 }