
'Declaration
<ComDefaultInterfaceAttribute(OpcLabs.EasyOpc.UA.Forms.Browsing.ComTypes._UABrowseNodeDescriptorCollection)> <ComVisibleAttribute(True)> <GuidAttribute("085292E1-55BC-46BB-9C56-0FCB914533D9")> <TypeConverterAttribute(System.ComponentModel.CollectionConverter)> <DefaultMemberAttribute("Item")> <DebuggerTypeProxyAttribute(System.Collections.Generic.Mscorlib_CollectionDebugView`1)> <DebuggerDisplayAttribute("Count = {Count}")> <SerializableAttribute()> Public Class UABrowseNodeDescriptorCollection Inherits System.Collections.ObjectModel.ObservableCollection(Of UABrowseNodeDescriptor) Implements OpcLabs.EasyOpc.UA.Forms.Browsing.ComTypes._UABrowseNodeDescriptorCollection, System.Collections.Generic.ICollection(Of UABrowseNodeDescriptor), System.Collections.Generic.IEnumerable(Of UABrowseNodeDescriptor), System.Collections.Generic.IList(Of UABrowseNodeDescriptor), System.Collections.Generic.IReadOnlyCollection(Of UABrowseNodeDescriptor), System.Collections.Generic.IReadOnlyList(Of UABrowseNodeDescriptor), System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.Collections.Specialized.INotifyCollectionChanged, System.ComponentModel.INotifyPropertyChanged
'Usage
Dim instance As UABrowseNodeDescriptorCollection
[ComDefaultInterface(OpcLabs.EasyOpc.UA.Forms.Browsing.ComTypes._UABrowseNodeDescriptorCollection)] [ComVisible(true)] [Guid("085292E1-55BC-46BB-9C56-0FCB914533D9")] [TypeConverter(System.ComponentModel.CollectionConverter)] [DefaultMember("Item")] [DebuggerTypeProxy(System.Collections.Generic.Mscorlib_CollectionDebugView`1)] [DebuggerDisplay("Count = {Count}")] [Serializable()] public class UABrowseNodeDescriptorCollection : System.Collections.ObjectModel.ObservableCollection<UABrowseNodeDescriptor>, OpcLabs.EasyOpc.UA.Forms.Browsing.ComTypes._UABrowseNodeDescriptorCollection, System.Collections.Generic.ICollection<UABrowseNodeDescriptor>, System.Collections.Generic.IEnumerable<UABrowseNodeDescriptor>, System.Collections.Generic.IList<UABrowseNodeDescriptor>, System.Collections.Generic.IReadOnlyCollection<UABrowseNodeDescriptor>, System.Collections.Generic.IReadOnlyList<UABrowseNodeDescriptor>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.Collections.Specialized.INotifyCollectionChanged, System.ComponentModel.INotifyPropertyChanged
[ComDefaultInterface(OpcLabs.EasyOpc.UA.Forms.Browsing.ComTypes._UABrowseNodeDescriptorCollection)] [ComVisible(true)] [Guid("085292E1-55BC-46BB-9C56-0FCB914533D9")] [TypeConverter(System.ComponentModel.CollectionConverter)] [DefaultMember("Item")] [DebuggerTypeProxy(System.Collections.Generic.Mscorlib_CollectionDebugView`1)] [DebuggerDisplay("Count = {Count}")] [Serializable()] public ref class UABrowseNodeDescriptorCollection : public System.Collections.ObjectModel.ObservableCollection<UABrowseNodeDescriptor>, OpcLabs.EasyOpc.UA.Forms.Browsing.ComTypes._UABrowseNodeDescriptorCollection, System.Collections.Generic.ICollection<UABrowseNodeDescriptor>, System.Collections.Generic.IEnumerable<UABrowseNodeDescriptor>, System.Collections.Generic.IList<UABrowseNodeDescriptor>, System.Collections.Generic.IReadOnlyCollection<UABrowseNodeDescriptor>, System.Collections.Generic.IReadOnlyList<UABrowseNodeDescriptor>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.Collections.Specialized.INotifyCollectionChanged, System.ComponentModel.INotifyPropertyChanged
// This example shows how the current node and selected nodes can be persisted between dialog invocations. using System.Windows.Forms; using OpcLabs.EasyOpc.UA.Forms.Browsing; namespace UAFormsDocExamples._UABrowseDialog { static partial class ShowDialog { public static void SelectionDescriptors(IWin32Window owner) { // The variables that persist the current and selected nodes. var currentNodeDescriptor = new UABrowseNodeDescriptor(); var selectionDescriptors = new UABrowseNodeDescriptorCollection(); // The initial current node (optional). currentNodeDescriptor.EndpointDescriptor = "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"; // Repeatedly show the dialog until the user cancels it. do { var browseDialog = new UABrowseDialog(); browseDialog.Mode.MultiSelect = true; // Set the dialog inputs from the persistence variables. browseDialog.InputsOutputs.CurrentNodeDescriptor = currentNodeDescriptor; browseDialog.InputsOutputs.SelectionDescriptors.Clear(); foreach (UABrowseNodeDescriptor browseNodeDescriptor in selectionDescriptors) browseDialog.InputsOutputs.SelectionDescriptors.Add(browseNodeDescriptor); DialogResult dialogResult = browseDialog.ShowDialog(owner); if (dialogResult != DialogResult.OK) break; // Update the persistence variables with the dialog output. currentNodeDescriptor = browseDialog.InputsOutputs.CurrentNodeDescriptor; selectionDescriptors.Clear(); foreach (UABrowseNodeDescriptor browseNodeDescriptor in browseDialog.InputsOutputs.SelectionDescriptors) selectionDescriptors.Add(browseNodeDescriptor); } while (true); } } }
# This example shows how the current node and selected nodes can be persisted between dialog invocations. # 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.UA import * from OpcLabs.EasyOpc.UA.Forms.Browsing import * # The variables that persist the current and selected nodes. currentNodeDescriptor = UABrowseNodeDescriptor() selectionDescriptors = UABrowseNodeDescriptorCollection() # The initial current node (optional). currentNodeDescriptor.EndpointDescriptor = UAEndpointDescriptor('opc.tcp://opcua.demo-this.com:51210/UA/SampleServer') # Repeatedly show the dialog until the user cancels it. while True: browseDialog = UABrowseDialog() browseDialog.Mode.MultiSelect = True # Set the dialog inputs from the persistence variables. browseDialog.InputsOutputs.CurrentNodeDescriptor = currentNodeDescriptor browseDialog.InputsOutputs.SelectionDescriptors.Clear() for browseNodeDescriptor in selectionDescriptors: browseDialog.InputsOutputs.SelectionDescriptors.Add(browseNodeDescriptor) dialogResult = browseDialog.ShowDialog() print(dialogResult) if dialogResult != DialogResult.OK: break # Update the persistence variables with the dialog output. currentNodeDescriptor = browseDialog.InputsOutputs.CurrentNodeDescriptor selectionDescriptors.Clear() for browseNodeDescriptor in browseDialog.InputsOutputs.SelectionDescriptors: selectionDescriptors.Add(browseNodeDescriptor) print('Finished.')
Rem This example shows how the current node and selected nodes can be persisted between dialog invocations. Option Explicit Const DialogResult_OK = 1 ' The variables that persist the current and selected nodes. Dim CurrentNodeDescriptor: Set CurrentNodeDescriptor = CreateObject("OpcLabs.EasyOpc.UA.Forms.Browsing.UABrowseNodeDescriptor") Dim SelectionDescriptors: Set SelectionDescriptors = CreateObject("OpcLabs.EasyOpc.UA.Forms.Browsing.UABrowseNodeDescriptorCollection") ' The initial current node (optional). CurrentNodeDescriptor.EndpointDescriptor.UrlString = "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer" ' Repeatedly show the dialog until the user cancels it. Do Dim BrowseDialog: Set BrowseDialog = CreateObject("OpcLabs.EasyOpc.UA.Forms.Browsing.UABrowseDialog") BrowseDialog.Mode.MultiSelect = True ' Set the dialog inputs from the persistence variables. Set BrowseDialog.InputsOutputs.CurrentNodeDescriptor = CurrentNodeDescriptor BrowseDialog.InputsOutputs.SelectionDescriptors.Clear Dim BrowseNodeDescriptor: For Each BrowseNodeDescriptor In SelectionDescriptors BrowseDialog.InputsOutputs.SelectionDescriptors.Add BrowseNodeDescriptor Next Dim dialogResult1: dialogResult1 = BrowseDialog.ShowDialog If dialogResult1 <> DialogResult_OK Then Exit Do End If ' Update the persistence variables with the dialog output. Set CurrentNodeDescriptor = BrowseDialog.InputsOutputs.CurrentNodeDescriptor selectionDescriptors.Clear For Each BrowseNodeDescriptor In BrowseDialog.InputsOutputs.SelectionDescriptors SelectionDescriptors.Add BrowseNodeDescriptor Next Loop While True
System.Object
System.Collections.ObjectModel.Collection<T>
System.Collections.ObjectModel.ObservableCollection<T>
OpcLabs.EasyOpc.UA.Forms.Browsing.UABrowseNodeDescriptorCollection