forked from ahyahy/OneScriptForms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventArgs.cs
More file actions
114 lines (99 loc) · 3.92 KB
/
EventArgs.cs
File metadata and controls
114 lines (99 loc) · 3.92 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
using ScriptEngine.Machine.Contexts;
using System.Reflection;
namespace osf
{
public class EventArgs
{
public ClEventArgs dll_obj;
public string EventString = "";
public dynamic Sender;
public EventArgs()
{
Sender = null;
}
//Свойства============================================================
//Методы============================================================
public virtual bool PostEvent()
{
if (Sender.GetType() == typeof(osf.ComboBox))
{
string s = "";
osf.ComboBox ComboBox1 = (osf.ComboBox)Sender;
if (ComboBox1.DrawMode != 0)
{
dynamic item = ComboBox1.Items[ComboBox1.SelectedIndex];
if (Sender.GetType() == typeof(osf.ComboBox))
{
string ObjType = item.GetType().ToString();
if (ObjType == "System.Data.DataRowView")
{
System.Data.DataRowView drv = (System.Data.DataRowView)item;
try
{
dynamic var1 = drv.Row[ComboBox1.DisplayMember];
System.Type Type1 = var1.GetType();
s = Type1.GetCustomAttribute<ContextClassAttribute>().GetName();
}
catch
{
if (drv.Row[ComboBox1.DisplayMember].GetType() == typeof(System.Boolean))
{
ScriptEngine.Machine.Values.BooleanValue Bool1;
if ((System.Boolean)drv.Row[ComboBox1.DisplayMember])
{
Bool1 = ScriptEngine.Machine.Values.BooleanValue.True;
}
else
{
Bool1 = ScriptEngine.Machine.Values.BooleanValue.False;
}
s = Bool1.ToString();
}
else
{
s = drv.Row[ComboBox1.DisplayMember].ToString();
}
}
}
}
else if (Sender.GetType() == typeof(osf.ListItem))
{
}
if (s == "")
{
try
{
System.Type Type1 = item.GetType();
s = Type1.GetCustomAttribute<ContextClassAttribute>().GetName();
}
catch
{
s = item.ToString();
}
}
ComboBox1.Text = s;
}
}
return true;
}
}
[ContextClass ("КлАргументыСобытия", "ClEventArgs")]
public class ClEventArgs : AutoContext<ClEventArgs>
{
public ClEventArgs()
{
EventArgs EventArgs1 = new EventArgs();
EventArgs1.dll_obj = this;
Base_obj = EventArgs1;
}
public ClEventArgs(EventArgs p1)
{
EventArgs EventArgs1 = p1;
EventArgs1.dll_obj = this;
Base_obj = EventArgs1;
}
public EventArgs Base_obj;
//Свойства============================================================
//Методы============================================================
}
}