forked from ahyahy/OneScriptForms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataView.cs
More file actions
223 lines (189 loc) · 5.87 KB
/
DataView.cs
File metadata and controls
223 lines (189 loc) · 5.87 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
using System.Collections;
using ScriptEngine.Machine.Contexts;
namespace osf
{
public class DataView : IEnumerable, IEnumerator
{
public ClDataView dll_obj;
private System.Collections.IEnumerator Enumerator;
public System.Data.DataView M_DataView;
public DataView()
{
M_DataView = new System.Data.DataView();
OneScriptForms.AddToHashtable(M_DataView, this);
}
public DataView(osf.DataView p1)
{
M_DataView = p1.M_DataView;
OneScriptForms.AddToHashtable(M_DataView, this);
}
public DataView(System.Data.DataView p1)
{
M_DataView = p1;
OneScriptForms.AddToHashtable(M_DataView, this);
}
public bool AllowEdit
{
get { return M_DataView.AllowEdit; }
set
{
M_DataView.AllowEdit = value;
System.Windows.Forms.Application.DoEvents();
}
}
public bool AllowNew
{
get { return M_DataView.AllowNew; }
set
{
M_DataView.AllowNew = value;
System.Windows.Forms.Application.DoEvents();
}
}
public bool ApplyDefaultSort
{
get { return M_DataView.ApplyDefaultSort; }
set
{
M_DataView.ApplyDefaultSort = value;
System.Windows.Forms.Application.DoEvents();
}
}
public int Count
{
get { return M_DataView.Count; }
}
public object Current
{
get { return (object)new DataRow((System.Data.DataRow)Enumerator.Current); }
}
public object get_Item(int index)
{
return new DataRowView(M_DataView[index]);
}
public void Reset()
{
Enumerator.Reset();
}
public string RowFilter
{
get { return M_DataView.RowFilter; }
set { M_DataView.RowFilter = value; }
}
public string Sort
{
get { return M_DataView.Sort; }
set { M_DataView.Sort = value; }
}
public osf.DataTable Table
{
get { return (DataTable)((DataTableEx)M_DataView.Table).M_Object; }
set { M_DataView.Table = (System.Data.DataTable)value.M_DataTable; }
}
public osf.DataRowView AddNew()
{
return new DataRowView(M_DataView.AddNew());
}
public void BeginInit()
{
M_DataView.BeginInit();
}
public void EndInit()
{
M_DataView.EndInit();
}
public System.Collections.IEnumerator GetEnumerator()
{
Enumerator = M_DataView.GetEnumerator();
return (IEnumerator)this;
}
public bool MoveNext()
{
return Enumerator.MoveNext();
}
}
[ContextClass ("КлПредставлениеДанных", "ClDataView")]
public class ClDataView : AutoContext<ClDataView>
{
public ClDataView()
{
DataView DataView1 = new DataView();
DataView1.dll_obj = this;
Base_obj = DataView1;
}
public ClDataView(DataView p1)
{
DataView DataView1 = p1;
DataView1.dll_obj = this;
Base_obj = DataView1;
}
public ClDataView(System.Data.DataView p1)
{
DataView DataView1 = new DataView(p1);
DataView1.dll_obj = this;
Base_obj = DataView1;
}
public DataView Base_obj;
[ContextProperty("Количество", "Count")]
public int Count
{
get { return Base_obj.Count; }
}
[ContextProperty("РазрешитьНовые", "AllowNew")]
public bool AllowNew
{
get { return Base_obj.AllowNew; }
set { Base_obj.AllowNew = value; }
}
[ContextProperty("РазрешитьРедактирование", "AllowEdit")]
public bool AllowEdit
{
get { return Base_obj.AllowEdit; }
set { Base_obj.AllowEdit = value; }
}
[ContextProperty("СортироватьПоУмолчанию", "ApplyDefaultSort")]
public bool ApplyDefaultSort
{
get { return Base_obj.ApplyDefaultSort; }
set { Base_obj.ApplyDefaultSort = value; }
}
[ContextProperty("Сортировка", "Sort")]
public string Sort
{
get { return Base_obj.Sort; }
set { Base_obj.Sort = value; }
}
[ContextProperty("Таблица", "Table")]
public ClDataTable Table
{
get { return (ClDataTable)OneScriptForms.RevertObj(Base_obj.Table); }
set { Base_obj.Table = value.Base_obj; }
}
[ContextProperty("ФильтрСтрок", "RowFilter")]
public string RowFilter
{
get { return Base_obj.RowFilter; }
set { Base_obj.RowFilter = value; }
}
[ContextMethod("ДобавитьНовуюСтроку", "AddNew")]
public ClDataRowView AddNew()
{
return new ClDataRowView(Base_obj.AddNew());
}
[ContextMethod("ЗакончитьИнициализацию", "EndInit")]
public void EndInit()
{
Base_obj.EndInit();
}
[ContextMethod("НачатьИнициализацию", "BeginInit")]
public void BeginInit()
{
Base_obj.BeginInit();
}
[ContextMethod("Элемент", "Item")]
public ClDataRowView Item(int p1)
{
return new ClDataRowView((osf.DataRowView)Base_obj.get_Item(p1));
}
}
}