-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNetbasic_Dynamic_Object.cs
More file actions
95 lines (71 loc) · 3.48 KB
/
Copy pathNetbasic_Dynamic_Object.cs
File metadata and controls
95 lines (71 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<<<<<<< HEAD
using System.Collections.Generic;
using System.Dynamic;
namespace Netbasic_Dynamic_Object
{
class Netbasic_Dynamic_Object
{
//we create a dynamic object property
public dynamic DynamicObject { get; set; }
//we create a property that will store the DynamicObject type
public object DynamicObjectType { get; set; }
//we create a dictionary interface property so that we can add and remove properties from our DynamicObject at runtime with string/object references like we would with reflection
public IDictionary<string, object> DynamicObjectProperties { get; set; }
//we create a property that will track the current index of the property we are referencing in an iteration
public int currentIndex { get; set; }
//our Netbasic_Dynamic_Object default constructor
public Netbasic_Dynamic_Object()
{
//we run our default setup
DefaultNDOSetup();
}
//a method that runs the default setup of an NDO object
public void DefaultNDOSetup()
{
//we initialize our dynamic object as an expandoobject
DynamicObject = new ExpandoObject();
//we set our DynamicObjectType to NDO_OBJECT
DynamicObjectType = Netbasic_Dynamic_Object_Controller.NDO_OBJECT;
//we initalize our DynamicObjectProperties as our DynamicObject property cast to a dictionary interface so that we can implement reflection-like adding and removing of properties
DynamicObjectProperties = (IDictionary<string, object>)DynamicObject;
//we initalize our currentIndex to 0
currentIndex = 0;
}
}
}
=======
using System.Collections.Generic;
using System.Dynamic;
namespace Netbasic_Dynamic_Object
{
public class Netbasic_Dynamic_Object
{
//we create a dynamic object property
public dynamic DynamicObject { get; set; }
//we create a property that will store the DynamicObject type
public object DynamicObjectType { get; set; }
//we create a dictionary interface property so that we can add and remove properties from our DynamicObject at runtime with string/object references like we would with reflection
public IDictionary<string, object> DynamicObjectProperties { get; set; }
//we create a property that will track the current index of the property we are referencing in an iteration
public int currentIndex { get; set; }
//our Netbasic_Dynamic_Object default constructor
public Netbasic_Dynamic_Object()
{
//we run our default setup
DefaultNDOSetup();
}
//a method that runs the default setup of an NDO object
public void DefaultNDOSetup()
{
//we initialize our dynamic object as an expandoobject
DynamicObject = new ExpandoObject();
//we set our DynamicObjectType to NDO_OBJECT
DynamicObjectType = Netbasic_Dynamic_Object_Controller.NDO_OBJECT;
//we initalize our DynamicObjectProperties as our DynamicObject property cast to a dictionary interface so that we can implement reflection-like adding and removing of properties
DynamicObjectProperties = (IDictionary<string, object>)DynamicObject;
//we initalize our currentIndex to 0
currentIndex = 0;
}
}
}
>>>>>>> cd1f19a510227db82206da930c71da8cd3d01175