QuickOPC User's Guide and Reference
ConditionElements Property (_AECategoryElement)
Example 



OpcLabs.EasyOpcClassic Assembly > OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.ComTypes Namespace > _AECategoryElement Interface : ConditionElements Property
Event conditions supported by this event category.
Syntax
'Declaration
 
<ElementsNotNullAttribute()>
<NotNullAttribute()>
Property ConditionElements As AEConditionElementCollection
'Usage
 
Dim instance As _AECategoryElement
Dim value As AEConditionElementCollection
 
instance.ConditionElements = value
 
value = instance.ConditionElements
[ElementsNotNull()]
[NotNull()]
AEConditionElementCollection ConditionElements {get; set;}
[ElementsNotNull()]
[NotNull()]
property AEConditionElementCollection^ ConditionElements {
   AEConditionElementCollection^ get();
   void set (    AEConditionElementCollection^ value);
}
Remarks

This is a keyed collection where the key is condition name, and the value is an OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.AEConditionElement.

Example
// This example shows information available about OPC event category.

using System;
using System.Diagnostics;
using OpcLabs.EasyOpc.AlarmsAndEvents;
using OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace;
using OpcLabs.EasyOpc.OperationModel;

namespace DocExamples.AlarmsAndEvents._AECategoryElement 
{ 
    class Properties 
    { 
        public static void Main1()
        {
            // Instantiate the client object.
            var client = new EasyAEClient();

            AECategoryElementCollection categoryElements;
            try
            {
                categoryElements = client.QueryEventCategories("", "OPCLabs.KitEventServer.2");
            }
            catch (OpcException opcException)
            {
                Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message);
                return;
            }

            foreach (AECategoryElement categoryElement in categoryElements)
            {
                Debug.Assert(!(categoryElement is null));

                Console.WriteLine("Information about category {0}:", categoryElement);
                Console.WriteLine("    .CategoryId: {0}", categoryElement.CategoryId);
                Console.WriteLine("    .Description: {0}", categoryElement.Description);
                Console.WriteLine("    .ConditionElements:");
                if (!(categoryElement.ConditionElements.Keys is null))
                    foreach (string conditionKey in categoryElement.ConditionElements.Keys)
                        Console.WriteLine("        {0}", conditionKey);
                Console.WriteLine("    .AttributeElements:");
                if (!(categoryElement.AttributeElements.Keys is null))
                    foreach (long attributeKey in categoryElement.AttributeElements.Keys)
                        Console.WriteLine("        {0}", attributeKey);
            }
        }
    } 
}
' This example shows information available about OPC event category.

Imports OpcLabs.EasyOpc.AlarmsAndEvents
Imports OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace
Imports OpcLabs.EasyOpc.OperationModel

Namespace DocExamples.AlarmsAndEvents._AECategoryElement

    Friend Class Properties
        Public Shared Sub Main1()
            Dim client = New EasyAEClient()

            Dim categoryElements As AECategoryElementCollection
            Try
                categoryElements = client.QueryEventCategories("", "OPCLabs.KitEventServer.2")
            Catch opcException As OpcException
                Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message)
                Exit Sub
            End Try

            For Each categoryElement As AECategoryElement In categoryElements
                Debug.Assert(categoryElement IsNot Nothing)

                Console.WriteLine("Information about category {0}:", categoryElement)
                Console.WriteLine("    .CategoryId: {0}", categoryElement.CategoryId)
                Console.WriteLine("    .Description: {0}", categoryElement.Description)
                Console.WriteLine("    .ConditionElements:")
                If categoryElement.ConditionElements.Keys IsNot Nothing Then
                    For Each conditionKey As String In categoryElement.ConditionElements.Keys
                        Console.WriteLine("        {0}", conditionKey)
                    Next conditionKey
                End If
                Console.WriteLine("    .AttributeElements:")
                If categoryElement.AttributeElements.Keys IsNot Nothing Then
                    For Each attributeKey As Long In categoryElement.AttributeElements.Keys
                        Console.WriteLine("        {0}", attributeKey)
                    Next attributeKey
                End If
            Next categoryElement
        End Sub
    End Class

End Namespace
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2012, Windows Server 2016; .NET Core, .NET 5, .NET 6: Linux, macOS, Microsoft Windows

See Also

Reference

_AECategoryElement Interface
_AECategoryElement Members