public void ClearFilters(
int queueIndex
)
Public Sub ClearFilters (
queueIndex As Integer
)
public:
void ClearFilters(
int queueIndex
)
The following example shows how to remove all filtering criteria from the message filter of the second receive queue (index 1).
// Create the object using the default configuration
//
Worker myWorker = new Worker();
// Set the filter of the second receive queue (index 1) to receive only echo messages with ID 0x15
//
FilteringCriterion criterion = new FilteringCriterion();
criterion.SetMessageType(MessageType.Echo, FilterBehavior.Include);
if (myWorker.AddFilter(1, criterion))
{
criterion.SetSingleId(0x15, FilterMode.Extended);
if (myWorker.AddFilter(1, criterion))
Console.WriteLine("Receiving only Echo messages with extended ID equals to 0x15...");
else
Console.WriteLine("The given filter is already registered.");
}
else
Console.WriteLine("The given filter is already registered.");
// All filtering criteria from the message filter of the second receive queue (index 1) are removed
//
myWorker.ClearFilters(1);
Console.WriteLine("All filtering criteria were removed.");
' Create the object using the default configuration
'
Dim myWorker As Worker = New Worker()
' Set the filter of the second receive queue (index 1) to receive only echo messages with ID 0x15
'
Dim criterion As FilteringCriterion = New FilteringCriterion()
criterion.SetMessageType(MessageType.Echo, FilterBehavior.Include)
If myWorker.AddFilter(1, criterion) Then
criterion.SetSingleId(&H15, FilterMode.Extended)
If myWorker.AddFilter(1, criterion) Then
Console.WriteLine("Receiving only Echo messages with extended ID equals to 0x15...")
Else
Console.WriteLine("The given filter is already registered.")
End If
Else
Console.WriteLine("The given filter is already registered.")
End If
' All filtering criteria from the message filter of the second receive queue (index 1) are removed
'
myWorker.ClearFilters(1)
Console.WriteLine("All filtering criteria were removed.")
// Create the object using the default configuration
//
Worker^ myWorker = gcnew Worker();
// Set the filter of the default receive queue (index 0) to receive only echo messages with ID 0x15
//
FilteringCriterion criterion;
criterion.SetMessageType(MessageType::Echo, FilterBehavior::Include);
if (myWorker->AddFilter(1, criterion))
{
criterion.SetSingleId(0x15, FilterMode::Extended, FilterBehavior::Include);
if (myWorker->AddFilter(1, criterion))
Console::WriteLine("Receiving only Echo messages with extended ID equals to 0x15...");
else
Console::WriteLine("The given filter is already registered.");
}
else
Console::WriteLine("The given filter is already registered.");
// All filtering criteria from the message filter of the default receive queue (index 0) are removed
//
myWorker->ClearFilters(1);
Console::WriteLine("All filtering criteria were removed.");
IndexOutOfRangeException | The queueIndex parameter value is out of range. This must be in the range [0...ReceiveQueuesCount-1]. |