Skip to content

Commit 08a39f2

Browse files
committed
fix build error
1 parent 75470d5 commit 08a39f2

File tree

1 file changed

+8
-11
lines changed
  • snippets/csharp/System.Messaging/MessageQueue/GetAllMessages

1 file changed

+8
-11
lines changed

snippets/csharp/System.Messaging/MessageQueue/GetAllMessages/class1.cs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ public static void Main()
8989
// Demonstrate GetAllMessages.
9090
example.GetAllMessages();
9191

92-
// Demonstrate GetEnumerator.
93-
example.GetEnumerator();
94-
9592
// Demonstrate SetPermissions.
9693
example.SetPermissions_StringAccessrights();
9794

@@ -113,7 +110,7 @@ public static void Main()
113110
// Demonstrate Purge.
114111
example.Purge();
115112
}
116-
catch(System.Exception e)
113+
catch (Exception e)
117114
{
118115
// Write the exception information to the console.
119116
Console.WriteLine(e);
@@ -123,7 +120,7 @@ public static void Main()
123120
// Creates a new queue.
124121
public static void CreateQueue(string queuePath, bool transactional)
125122
{
126-
if(!MessageQueue.Exists(queuePath))
123+
if (!MessageQueue.Exists(queuePath))
127124
{
128125
MessageQueue.Create(queuePath, transactional);
129126
}
@@ -206,7 +203,7 @@ public void Send_ObjectStringTransaction()
206203
// Commit the transaction.
207204
transaction.Commit();
208205
}
209-
catch(System.Exception e)
206+
catch (System.Exception e)
210207
{
211208
// Cancel the transaction.
212209
transaction.Abort();
@@ -569,7 +566,7 @@ public void ReceiveByCorrelationId_StringTimespanTransaction()
569566
// Commit the transaction.
570567
transaction.Commit();
571568
}
572-
catch(System.Exception e)
569+
catch (System.Exception e)
573570
{
574571
// Cancel the transaction.
575572
transaction.Abort();
@@ -645,7 +642,7 @@ public void ReceiveByCorrelationId_StringTransaction()
645642
// Commit the transaction.
646643
transaction.Commit();
647644
}
648-
catch(System.Exception e)
645+
catch (System.Exception e)
649646
{
650647
// Cancel the transaction.
651648
transaction.Abort();
@@ -752,7 +749,7 @@ public void ReceiveById_StringTransaction()
752749
// Commit the transaction.
753750
transaction.Commit();
754751
}
755-
catch(System.Exception e)
752+
catch (System.Exception e)
756753
{
757754
// Cancel the transaction.
758755
transaction.Abort();
@@ -801,7 +798,7 @@ public void ReceiveById_StringTimespanTransaction()
801798
// Commit the transaction.
802799
transaction.Commit();
803800
}
804-
catch(System.Exception e)
801+
catch (System.Exception e)
805802
{
806803
// Cancel the transaction.
807804
transaction.Abort();
@@ -875,7 +872,7 @@ public void GetAllMessages()
875872
Message[] msgs = queue.GetAllMessages();
876873

877874
// Loop through the messages.
878-
foreach(Message msg in msgs)
875+
foreach (Message msg in msgs)
879876
{
880877
// Display the label of each message.
881878
Console.WriteLine(msg.Label);

0 commit comments

Comments
 (0)