QuickOPC User's Guide and Reference
AEAttributeDialog Class
Members  Example 



OpcLabs.EasyOpcForms Assembly > OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing Namespace : AEAttributeDialog Class
Displays a dialog box from which the user can select OPC-A&E event attributes.
Object Model
AEAttributeDialog ClassAEAttributeElement ClassAEAttributeElementCollection ClassAEAttributeElement ClassEasyAEClientSelector ClassServerDescriptor Class
Syntax
'Declaration
 
<CLSCompliantAttribute(True)>
<ComDefaultInterfaceAttribute(OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing.ComTypes._AEAttributeDialog)>
<ComVisibleAttribute(True)>
<GuidAttribute("E88F9177-F957-4612-94FA-DF9DCEA09779")>
<TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter)>
<DesignerCategoryAttribute("Component")>
Public NotInheritable Class AEAttributeDialog 
   Inherits AEDialog
   Implements OpcLabs.BaseLib.Forms.ComTypes._FormCommonDialog, OpcLabs.BaseLib.Forms.ComTypes._SizableCommonDialog, OpcLabs.BaseLib.Licensing.ILicensingContextHolder, OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing.ComTypes._AEAttributeDialog, OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing.ComTypes._AEDialog, System.ComponentModel.IComponent, System.IDisposable 
'Usage
 
Dim instance As AEAttributeDialog
[CLSCompliant(true)]
[ComDefaultInterface(OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing.ComTypes._AEAttributeDialog)]
[ComVisible(true)]
[Guid("E88F9177-F957-4612-94FA-DF9DCEA09779")]
[TypeConverter(System.ComponentModel.ExpandableObjectConverter)]
[DesignerCategory("Component")]
public sealed class AEAttributeDialog : AEDialog, OpcLabs.BaseLib.Forms.ComTypes._FormCommonDialog, OpcLabs.BaseLib.Forms.ComTypes._SizableCommonDialog, OpcLabs.BaseLib.Licensing.ILicensingContextHolder, OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing.ComTypes._AEAttributeDialog, OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing.ComTypes._AEDialog, System.ComponentModel.IComponent, System.IDisposable  
[CLSCompliant(true)]
[ComDefaultInterface(OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing.ComTypes._AEAttributeDialog)]
[ComVisible(true)]
[Guid("E88F9177-F957-4612-94FA-DF9DCEA09779")]
[TypeConverter(System.ComponentModel.ExpandableObjectConverter)]
[DesignerCategory("Component")]
public ref class AEAttributeDialog sealed : public AEDialog, OpcLabs.BaseLib.Forms.ComTypes._FormCommonDialog, OpcLabs.BaseLib.Forms.ComTypes._SizableCommonDialog, OpcLabs.BaseLib.Licensing.ILicensingContextHolder, OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing.ComTypes._AEAttributeDialog, OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing.ComTypes._AEDialog, System.ComponentModel.IComponent, System.IDisposable  
Remarks

This is a modal dialog box; therefore, when shown, it blocks the rest of the application until the user has made a selection. When a dialog box is displayed modally, no input (keyboard or mouse click) can occur except to objects on the dialog box. The program must hide or close the dialog box (usually in response to some user action) before input to the calling program can occur.

 

In This Topic

General

Icon:

With AEAttributeDialog, your application can integrate a dialog box from which the user can select OPC-A&E event attributes:

The MultiSelect property determines whether the dialog allows the user to select multiple attributes as output.

Use the ServerDescriptor property to specify the OPC Alarms&Events server and the CategoryId property to specify the event category to be browsed. Then, call the ShowDialog method. If the result is equal to DialogResult.OK, the user has finished the selection, and information about it can be retrieved.

When the dialog is in single-select mode, you can obtain the information about the selected attribute from the AttributeElement or AttributeId property. When the dialog is in multi-select mode, the information about the selected categories is in the AttributeElements and AttributeIds properties.

Example

// This example shows how to let the user browse for an OPC Alarms&Events attribute.

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

namespace FormsDocExamples._AEAttributeDialog
{
    static class ShowDialog
    {
        public static void Main1(IWin32Window owner)
        {
            var attributeDialog = new AEAttributeDialog
            {
                ServerDescriptor = {ServerClass = "OPCLabs.KitEventServer.2"},
                CategoryId = 0x00EC0001
            };

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

            // Display results
            MessageBox.Show(owner, $"AttributeElement: {attributeDialog.AttributeElement}");
        }
    }
}
# This example shows how to let the user browse for an OPC Alarms&Events attribute.

# The QuickOPC package is needed. Install it using "pip install opclabs_quickopc".
import opclabs_quickopc

# Import .NET namespaces.
from System.Windows.Forms import *
from OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing import *


attributeDialog = AEAttributeDialog()
attributeDialog.ServerDescriptor.ServerClass = "OPCLabs.KitEventServer.2"
attributeDialog.CategoryId = 0x00EC0001

dialogResult = attributeDialog.ShowDialog()
print(dialogResult)
if dialogResult != DialogResult.OK:
    exit()

# Display results.
print('AttributeElement: ', attributeDialog.AttributeElement, sep='')

 

Advanced

If you want to change the parameters of the client object the component uses to perform its OPC operations, you can use the ClientSelector Property.

 

 

Example

.NET

// This example shows how to let the user browse for an OPC Alarms&Events attribute.

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

namespace FormsDocExamples._AEAttributeDialog
{
    static class ShowDialog
    {
        public static void Main1(IWin32Window owner)
        {
            var attributeDialog = new AEAttributeDialog
            {
                ServerDescriptor = {ServerClass = "OPCLabs.KitEventServer.2"},
                CategoryId = 0x00EC0001
            };

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

            // Display results
            MessageBox.Show(owner, $"AttributeElement: {attributeDialog.AttributeElement}");
        }
    }
}
# This example shows how to let the user browse for an OPC Alarms&Events attribute.

# The QuickOPC package is needed. Install it using "pip install opclabs_quickopc".
import opclabs_quickopc

# Import .NET namespaces.
from System.Windows.Forms import *
from OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing import *


attributeDialog = AEAttributeDialog()
attributeDialog.ServerDescriptor.ServerClass = "OPCLabs.KitEventServer.2"
attributeDialog.CategoryId = 0x00EC0001

dialogResult = attributeDialog.ShowDialog()
print(dialogResult)
if dialogResult != DialogResult.OK:
    exit()

# Display results.
print('AttributeElement: ', attributeDialog.AttributeElement, sep='')
Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         System.Windows.Forms.CommonDialog
            OpcLabs.BaseLib.Forms.ConcreteCommonDialog
               OpcLabs.BaseLib.Forms.FormCommonDialog
                  OpcLabs.BaseLib.Forms.SizableCommonDialog
                     OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing.AEDialog
                        OpcLabs.EasyOpc.AlarmsAndEvents.Forms.Browsing.AEAttributeDialog

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