-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDataItem.cs
More file actions
103 lines (91 loc) · 2.52 KB
/
DataItem.cs
File metadata and controls
103 lines (91 loc) · 2.52 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
96
97
98
99
100
101
102
103
using System;
using ScriptEngine.Machine.Contexts;
using ScriptEngine.Machine;
namespace osf
{
public class DataItem
{
public ClDataItem dll_obj;
public object Index;
public System.Data.DataRow M_DataRow;
public DataItem()
{
}
public DataItem(osf.DataItem p1)
{
M_DataRow = p1.M_DataRow;
Index = p1.Index;
}
public DataItem(System.Data.DataRow p1, object p2)
{
M_DataRow = p1;
Index = p2;
}
public osf.DataRow DataRow
{
get { return new DataRow(M_DataRow); }
set { M_DataRow = value.M_DataRow; }
}
public object Value
{
get
{
if (Index != null)
{
if (Index.GetType() == typeof(int))
{
return M_DataRow[Convert.ToInt32(Index)];
}
if (Index.GetType() == typeof(string))
{
return M_DataRow[Convert.ToString(Index)];
}
}
return null;
}
set
{
if (Index is string)
{
M_DataRow[(string)Index] = value;
}
else
{
M_DataRow[(int)Index] = value;
}
}
}
}
[ContextClass("КлЭлементДанных", "ClDataItem")]
public class ClDataItem : AutoContext<ClDataItem>
{
public ClDataItem()
{
DataItem DataItem1 = new DataItem();
DataItem1.dll_obj = this;
Base_obj = DataItem1;
}
public ClDataItem(DataItem p1)
{
DataItem DataItem1 = p1;
DataItem1.dll_obj = this;
Base_obj = DataItem1;
}
public DataItem Base_obj;
[ContextProperty("Значение", "Value")]
public IValue Value
{
get { return OneScriptForms.RevertObj(Base_obj.Value); }
set
{
Base_obj.Value = OneScriptForms.DefineTypeIValue(value);
}
}
[ContextProperty("СтрокаДанных", "DataRow")]
public ClDataRow DataRow
{
get { return (ClDataRow)OneScriptForms.RevertObj(Base_obj.DataRow); }
set { Base_obj.DataRow = value.Base_obj; }
}
}
}