source: azure_iot_hub_f767zi/trunk/asp_baseplatform/lwip/contrib-2.1.0/apps/LwipMibCompiler/SharpSnmpLib/Mib/ObjectIdentifier.cs@ 457

Last change on this file since 457 was 457, checked in by coas-nagasima, 4 years ago

ファイルを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csharp;charset=UTF-8
File size: 1.3 KB
Line 
1using System.Collections.Generic;
2using System.Text;
3
4namespace Lextm.SharpSnmpLib.Mib
5{
6 public class ObjectIdentifier: List<KeyValuePair<string, uint>>
7 {
8 public void Add(string name, uint oid)
9 {
10 this.Add(new KeyValuePair<string, uint>(name, oid));
11 }
12
13 public void Prepend(string name, uint oid)
14 {
15 this.Insert(0, new KeyValuePair<string, uint>(name, oid));
16 }
17
18 public void Insert(int index, string name, uint oid)
19 {
20 this.Insert(index, new KeyValuePair<string, uint>(name, oid));
21 }
22
23 public string GetOidString()
24 {
25 StringBuilder result = new StringBuilder();
26
27 foreach (KeyValuePair<string, uint> level in this)
28 {
29 result.Append(level.Value);
30 result.Append('.');
31 }
32
33 if (result.Length > 0)
34 {
35 result.Length--;
36 }
37
38 return result.ToString();
39 }
40
41 public uint[] GetOidValues()
42 {
43 List<uint> result = new List<uint>();
44
45 foreach (KeyValuePair<string, uint> level in this)
46 {
47 result.Add(level.Value);
48 }
49
50 return result.ToArray();
51 }
52
53 }
54}
Note: See TracBrowser for help on using the repository browser.