Closed invinctus closed 4 years ago
Great question. The following should filter the subscription to receive only events with "SourceName" Equals "CNC"
WhereClause = new ContentFilter
{
Elements = new ContentFilterElement[]
{
new ContentFilterElement
{
FilterOperator = FilterOperator.Equals,
FilterOperands = new FilterOperand[]{
new SimpleAttributeOperand{
BrowsePath= new []{ QualifiedName.Parse("SourceName") },
AttributeId=AttributeIds.Value
},
new LiteralOperand{ Value= new Variant("CNC") }
}
}
}
}
Yep that does the trick, I was pretty close just missed those sub classes.
Thanks.
Hi,
I'm trying to add a where clause to an event subscription but I cannot figure out how to set the filter operands. I was expecting to do something like this:
But the FilterOperand class has no properties and I cant figure out how I need to set the operands for the filter.