-
Notifications
You must be signed in to change notification settings - Fork 0
/
AvcPalette.cs
326 lines (308 loc) · 7.69 KB
/
AvcPalette.cs
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.Threading;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.ApplicationServices.Core;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Windows;
using AVC.Properties;
namespace AVC
{
// Token: 0x0200005E RID: 94
public class AvcPalette
{
// Token: 0x0600041A RID: 1050 RVA: 0x00027AA8 File Offset: 0x00025CA8
[CommandMethod("AvcPalette")]
public static void AvcPaletteCommand()
{
try
{
y.a();
if (AvcPalette.a == null || AvcPalette.a.IsDisposed)
{
CultureInfo currentUICulture = Thread.CurrentThread.CurrentUICulture;
if (h.e())
{
CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
if (currentUICulture != currentCulture)
{
Thread.CurrentThread.CurrentUICulture = currentCulture;
}
}
try
{
AvcPalette.c = new a4();
AvcPalette.a = new PaletteSet("A>V>C>", "AvcPalette", new Guid("29E0BFF2-50E4-4F95-976F-54206038D36E"));
AvcPalette.a.Style = 62;
AvcPalette.a.Style |= 128;
AvcPalette.a.MinimumSize = new Size(150, 25);
AvcPalette.a.Size = new Size(200, 100);
AvcPalette.a.StateChanged += new PaletteSetStateEventHandler(AvcPalette.a);
AvcPalette.a.EnableTransparency(true);
AvcPalette.a.Icon = Resources.Kit;
AvcPalette.a.Add("A>V>C>", AvcPalette.c);
AvcPalette.d();
AvcPalette.a.Visible = true;
}
finally
{
if (currentUICulture != Thread.CurrentThread.CurrentUICulture)
{
Thread.CurrentThread.CurrentUICulture = currentUICulture;
}
}
}
else if (AvcPalette.b)
{
AvcPalette.a.Close();
AvcPalette.a.Visible = false;
AvcPalette.c();
}
else
{
AvcPalette.a.Activate(0);
AvcPalette.d();
AvcPalette.a.Visible = true;
p.c.i();
}
}
catch (CancelException)
{
ah.c();
}
catch (WarningException ex)
{
ah.a(ex.Message);
}
catch (Exception a_)
{
ah.a(a_, "");
}
}
// Token: 0x0600041B RID: 1051 RVA: 0x00027CBC File Offset: 0x00025EBC
private static void a(object A_0, PaletteSetStateEventArgs A_1)
{
try
{
if (A_1.NewState == null && AvcPalette.b)
{
AvcPalette.b();
AvcPalette.b(Application.DocumentManager.MdiActiveDocument);
AvcPalette.b = false;
}
else if (A_1.NewState == 1 && !AvcPalette.b)
{
AvcPalette.c(Application.DocumentManager.MdiActiveDocument);
AvcPalette.b = true;
}
}
catch (Exception a_)
{
ah.a(a_, "");
}
}
// Token: 0x0600041C RID: 1052 RVA: 0x00027D38 File Offset: 0x00025F38
private static void d()
{
Application.DocumentManager.DocumentActivated -= new DocumentCollectionEventHandler(AvcPalette.b);
Application.DocumentManager.DocumentActivated += new DocumentCollectionEventHandler(AvcPalette.b);
Application.DocumentManager.DocumentToBeDeactivated -= new DocumentCollectionEventHandler(AvcPalette.a);
Application.DocumentManager.DocumentToBeDeactivated += new DocumentCollectionEventHandler(AvcPalette.a);
}
// Token: 0x0600041D RID: 1053 RVA: 0x00027D9D File Offset: 0x00025F9D
private static void c()
{
Application.DocumentManager.DocumentActivated -= new DocumentCollectionEventHandler(AvcPalette.b);
Application.DocumentManager.DocumentToBeDeactivated -= new DocumentCollectionEventHandler(AvcPalette.a);
}
// Token: 0x0600041E RID: 1054 RVA: 0x00027DCB File Offset: 0x00025FCB
private static void c(Document A_0)
{
if (A_0 == null)
{
return;
}
A_0.ImpliedSelectionChanged -= AvcPalette.a;
A_0.ImpliedSelectionChanged += AvcPalette.a;
}
// Token: 0x0600041F RID: 1055 RVA: 0x00027DFB File Offset: 0x00025FFB
private static void b(Document A_0)
{
if (A_0 == null)
{
return;
}
A_0.ImpliedSelectionChanged -= AvcPalette.a;
}
// Token: 0x06000420 RID: 1056 RVA: 0x00027E1C File Offset: 0x0002601C
private static void a(object A_0, EventArgs A_1)
{
try
{
if (A_1 == null || !(A_0 is Document))
{
AvcPalette.b();
}
else
{
AvcPalette.a();
AvcPalette.b();
AvcPalette.a(A_0 as Document);
}
}
catch (CancelException)
{
ah.c();
}
catch (WarningException ex)
{
ah.a(ex.Message);
}
catch (Exception a_)
{
AvcPalette.b();
ah.a(a_, "");
}
}
// Token: 0x06000421 RID: 1057 RVA: 0x00027EA0 File Offset: 0x000260A0
private static void b()
{
if (AvcPalette.a == null || AvcPalette.c == null || !AvcPalette.b)
{
return;
}
AvcPalette.c.b();
}
// Token: 0x06000422 RID: 1058 RVA: 0x00027EC8 File Offset: 0x000260C8
private static void a()
{
if (AvcPalette.a == null || AvcPalette.c == null || !AvcPalette.b)
{
return;
}
AvcPalette.c.c();
}
// Token: 0x06000423 RID: 1059 RVA: 0x00027EF0 File Offset: 0x000260F0
private static void a(Document A_0)
{
if (A_0 == null)
{
return;
}
PromptSelectionResult promptSelectionResult = null;
try
{
promptSelectionResult = A_0.Editor.SelectImplied();
}
catch (Exception ex)
{
if (ex.ErrorStatus != 2)
{
throw ex;
}
promptSelectionResult = null;
}
if (promptSelectionResult == null || promptSelectionResult.Status != 5100)
{
return;
}
AvcPalette.a(new List<ObjectId>(promptSelectionResult.Value.GetObjectIds()));
}
// Token: 0x06000424 RID: 1060 RVA: 0x00027F60 File Offset: 0x00026160
private static void a(List<ObjectId> A_0)
{
if (A_0 == null || A_0.Count == 0 || AvcPalette.a == null || AvcPalette.c == null || !AvcPalette.b)
{
return;
}
if (AvcPalette.c != null)
{
AvcPalette.c.a(A_0);
}
}
// Token: 0x06000425 RID: 1061 RVA: 0x00027F9C File Offset: 0x0002619C
private static void b(object A_0, DocumentCollectionEventArgs A_1)
{
try
{
if (A_1.Document == null)
{
if (AvcPalette.a != null && AvcPalette.b)
{
AvcPalette.a.Visible = false;
AvcPalette.d = true;
}
}
else
{
if (AvcPalette.a != null && AvcPalette.b && !AvcPalette.d)
{
AvcPalette.c(A_1.Document);
}
if (AvcPalette.d && AvcPalette.a != null && !AvcPalette.b)
{
AvcPalette.d = false;
AvcPalette.a.Visible = true;
}
}
}
catch (CancelException)
{
ah.c();
}
catch (WarningException ex)
{
ah.a(ex.Message);
}
catch (Exception a_)
{
ah.a(a_, "");
}
}
// Token: 0x06000426 RID: 1062 RVA: 0x0002807C File Offset: 0x0002627C
private static void a(object A_0, DocumentCollectionEventArgs A_1)
{
try
{
if (!(A_1.Document == null))
{
using (A_1.Document.a())
{
AvcPalette.a();
}
AvcPalette.b();
if (AvcPalette.b)
{
AvcPalette.b(A_1.Document);
}
}
}
catch (CancelException)
{
ah.c();
}
catch (WarningException ex)
{
ah.a(ex.Message);
}
catch (Exception a_)
{
ah.a(a_, "");
}
}
// Token: 0x04000225 RID: 549
private static PaletteSet a;
// Token: 0x04000226 RID: 550
private static bool b = false;
// Token: 0x04000227 RID: 551
private static a4 c;
// Token: 0x04000228 RID: 552
private static bool d = false;
// Token: 0x04000229 RID: 553
private static ObjectId e = ObjectId.Null;
}
}