private static bool SupportsAccessMode(string formatName, int accessType, out MsmqException msmqException)
 {
     msmqException = null;
     try
     {
         using (MsmqQueue queue = new MsmqQueue(formatName, accessType))
         {
             queue.GetHandle();
         }
     }
     catch (Exception exception)
     {
         msmqException = exception as MsmqException;
         if (msmqException == null)
         {
             throw;
         }
         return(false);
     }
     return(true);
 }
 public static bool IsReadable(string formatName, out MsmqException ex)
 {
     return(SupportsAccessMode(formatName, 1, out ex));
 }
Example #3
0
 public static bool IsReadable(string formatName, out MsmqException ex)
 {
     return(SupportsAccessMode(formatName, UnsafeNativeMethods.MQ_RECEIVE_ACCESS, out ex));
 }