-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathColorDialog.cs
More file actions
114 lines (97 loc) · 3 KB
/
ColorDialog.cs
File metadata and controls
114 lines (97 loc) · 3 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 ScriptEngine.Machine;
using System.Threading;
namespace osf
{
public class ColorDialogEx : System.Windows.Forms.ColorDialog
{
public osf.ColorDialog M_Object;
}
public class ColorDialog : CommonDialog
{
public ClColorDialog dll_obj;
public ColorDialogEx M_ColorDialog;
public ColorDialog()
{
M_ColorDialog = new ColorDialogEx();
M_ColorDialog.M_Object = this;
base.M_CommonDialog = M_ColorDialog;
}
public ColorDialog(osf.ColorDialog p1)
{
M_ColorDialog = p1.M_ColorDialog;
M_ColorDialog.M_Object = this;
base.M_CommonDialog = M_ColorDialog;
}
public ColorDialog(System.Windows.Forms.ColorDialog p1)
{
M_ColorDialog = (ColorDialogEx)p1;
M_ColorDialog.M_Object = this;
base.M_CommonDialog = M_ColorDialog;
}
public osf.Color Color
{
get { return new Color(M_ColorDialog.Color); }
set { M_ColorDialog.Color = value.M_Color; }
}
}
[ContextClass("КлДиалогВыбораЦвета", "ClColorDialog")]
public class ClColorDialog : AutoContext<ClColorDialog>
{
private ClColor color;
public ClColorDialog()
{
ColorDialog ColorDialog1 = new ColorDialog();
ColorDialog1.dll_obj = this;
Base_obj = ColorDialog1;
color = new ClColor(Base_obj.Color);
}
public ClColorDialog(ColorDialog p1)
{
ColorDialog ColorDialog1 = p1;
ColorDialog1.dll_obj = this;
Base_obj = ColorDialog1;
color = new ClColor(Base_obj.Color);
}
public ColorDialog Base_obj;
private string name;
[ContextProperty("Имя", "Name")]
public string Name
{
get { return name; }
set { name = value; }
}
[ContextProperty("Тип", "Type")]
public ClType Type
{
get { return new ClType(this); }
}
[ContextProperty("Цвет", "Color")]
public ClColor Color
{
get { return color; }
set
{
color = value;
Base_obj.Color = value.Base_obj;
}
}
[ContextMethod("Освободить", "Dispose")]
public void Dispose()
{
Base_obj.Dispose();
}
[ContextMethod("ПоказатьДиалог", "ShowDialog")]
public IValue ShowDialog()
{
int Res1 = 0;
var thread = new Thread(() => Res1 = (int)Base_obj.ShowDialog());
thread.IsBackground = true;
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
color = new ClColor(Base_obj.Color);
return ValueFactory.Create(Res1);
}
}
}