Dart.Snmp Namespace : VariableList Class |
<SerializableAttribute()> Public Class VariableList Inherits System.Collections.Generic.SortedList(Of String,Variable)
Dim instance As VariableList
[Serializable()] public class VariableList : System.Collections.Generic.SortedList<string,Variable>
[Serializable()] public __gc class VariableList : public System.Collections.Generic.SortedList<string,Variable>
[Serializable()] public ref class VariableList : public System.Collections.Generic.SortedList<String,Variable>
The Agent class uses Agent.Variables to generate a response for each request it processes.
This collection is lexicographically sorted by instance id (IID); each IID must be unique. The IID is used as the key to lookup variables in the list.
Users should synchronize access by using the lock construct on the SyncRoot property.
private void button1_Click(object sender, EventArgs e) { //Perform MIB walk on a worker thread manager1.Start(walkMib, manager1.Mib.GetByNodeName(NodeName.system).Oid); } private void walkMib(SnmpSocket managerSocket, object state) { //The state contains the OID to walk (in this case, the system group) string oid = state as string; //Walk the MIB from the specified root OID VariableList variables = managerSocket.Walk(oid, myAgentAddress); //Marshal variables returned to the UI thread using the Walk event manager1.Marshal(oid, variables, "", null); } private void manager1_Walk(object sender, WalkEventArgs e) { //Populate a treeview control with the returned variables e.Variables.Populate(tvwVariables, e.Oid, manager1.Mib); }
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) 'Perform MIB walk on a worker thread manager1.Start(AddressOf walkMib, manager1.Mib.GetByNodeName(NodeName.system).Oid) End Sub Private Sub walkMib(ByVal managerSocket As SnmpSocket, ByVal state As Object) 'The state contains the OID to walk (in this case, the system group) Dim oid As String = TryCast(state, String) 'Walk the MIB from the specified root OID Dim variables As VariableList = managerSocket.Walk(oid, myAgentAddress) 'Marshal variables returned to the UI thread using the Walk event manager1.Marshal(oid, variables, "", Nothing) End Sub Private Sub manager1_Walk(ByVal sender As Object, ByVal e As WalkEventArgs) 'Populate a treeview control with the returned variables e.Variables.Populate(tvwVariables, e.Oid, manager1.Mib) End Sub
System.Object
System.Collections.Generic.SortedList<TKey,TValue>
Dart.Snmp.VariableList