/// <summary>Tries to delete an existing message queue, returns TRUE if the queue was deleted, FALSE if the queue does not exists</summary> /// <param name="formatName">The format name (NOT path name) of the queue</param> public static bool TryDelete(string formatName) { Contract.Requires(!string.IsNullOrWhiteSpace(formatName)); int res = Native.DeleteQueue(formatName); if ((ErrorCode)res == ErrorCode.QueueNotFound) { return(false); } if (Native.IsError(res)) { throw new QueueException(res); } return(true); }