OPC Studio User's Guide and Reference
CategoryElements Property (AECategoryDialog)
Example 



View with Navigation Tools
OpcLabs.EasyOpcForms Assembly > OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing Namespace > AECategoryDialog Class : CategoryElements Property
A collection of category elements (OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.AECategoryElement), keyed by their Category Ids.
Syntax
'Declaration
 
Public ReadOnly Property CategoryElements As AECategoryElementCollection
 
'Usage
 
Dim instance As AECategoryDialog
Dim value As AECategoryElementCollection
 
instance.CategoryElements = value
 
value = instance.CategoryElements

Property Value

The value of this property cannot be null (Nothing in Visual Basic).

The individual elements of the property value cannot be null (Nothing in Visual Basic).

Remarks

The getter method of this property is pure, i.e. it does not have observable side effects.

Example
// This example shows how to let the user browse for OPC Alarms&Events categories. 
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
// OPC client and subscriber examples in C# on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-CSharp .
// Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own
// a commercial license in order to use Online Forums, and we reply to every post.

using System.Linq;
using System.Windows.Forms;
using OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing;

namespace FormsDocExamples._AECategoryDialog
{
    static class ShowDialog
    {
        public static void Main1(IWin32Window owner)
        {
            var categoryDialog = new AECategoryDialog
            {
                ServerDescriptor = {ServerClass = "OPCLabs.KitEventServer.2"}
            };

            DialogResult dialogResult = categoryDialog.ShowDialog(owner);
            if (dialogResult != DialogResult.OK)
                return;

            // Display results
            string categoryElementsString = string.Join("\n", categoryDialog.CategoryElements.Select(element => element));
            MessageBox.Show(owner, categoryElementsString);
        }
    }
}
Requirements

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

See Also