• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 namespace Lextm.SharpSnmpLib.Mib.Elements.Types
3 {
4     public abstract class BaseType : ITypeAssignment
5     {
6         private IModule _module;
7         private string _name;
8 
BaseType(IModule module, string name)9         protected BaseType(IModule module, string name)
10         {
11             _module = module;
12             _name   = name;
13         }
14 
15         public virtual IModule Module
16         {
17             // differentiate between:
18             //    FddiTimeNano ::= INTEGER (0..2147483647)
19             //    which is an IntegerType which appears under Types in a MibModule and therefore has a name and module
20             // and
21             //    SYNTAX INTEGER (0..2147483647)
22             //    which is also an IntegerType but not defined as a separate type and therefore has NO name and NO module
23             get
24             {
25                 if (!string.IsNullOrEmpty(_name))
26                 {
27                     return _module;
28                 }
29                 else
30                 {
31                     return null;
32                 }
33             }
34             protected set { _module = value; }
35         }
36 
37         public virtual string Name
38         {
39             get
40             {
41                 if (!string.IsNullOrEmpty(_name))
42                 {
43                     return _name;
44                 }
45                 else
46                 {
47                     return "{ Implicit Base Type }";
48                 }
49             }
50             protected set { _name = value; }
51         }
52 
53     }
54 }
55