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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
|
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Forms;
using System.Windows.Markup;
using System.Windows.Media;
using HtmlAgilityPack;
using Microsoft.Win32;
using mshtml;
namespace Gestor.Application.Componentes;
public class WebEditor : UserControl, IComponentConnector
{
private ColorDialog ColorDialog;
public static readonly DependencyProperty ImageVisibilityProperty = DependencyProperty.Register("ImageVisibility", typeof(Visibility), typeof(WebEditor), (PropertyMetadata)new FrameworkPropertyMetadata((object)(Visibility)2, (FrameworkPropertyMetadataOptions)256));
public static readonly DependencyProperty BarVisibilityProperty = DependencyProperty.Register("BarVisibility", typeof(Visibility), typeof(WebEditor), (PropertyMetadata)new FrameworkPropertyMetadata((object)(Visibility)0, (FrameworkPropertyMetadataOptions)256));
public static readonly DependencyProperty BodyProperty = DependencyProperty.Register("Body", typeof(string), typeof(WebEditor), (PropertyMetadata)new FrameworkPropertyMetadata((object)string.Empty, new PropertyChangedCallback(OnBoundBodyChanged)));
public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register("IsReadOnly", typeof(bool), typeof(WebEditor), (PropertyMetadata)new FrameworkPropertyMetadata((object)false, new PropertyChangedCallback(OnBoundReadOnlyChanged)));
internal WrapPanel PanelControls;
internal ComboBox ComboTextFormat;
internal ComboBox ComboFontFamily;
internal ComboBox ComboFontSize;
internal Button SettingsBold;
internal Button SettingsItalic;
internal Button SettingsUnderLine;
internal Button SettingsFontColor;
internal Button SettingsBullets;
internal Button SettingsNumbered;
internal Button SettingsLeftAlign;
internal Button SettingsCenter;
internal Button SettingsRightAlign;
internal Button SettingsJustifyFull;
internal Button SettingsLink;
internal TextBox ImagemLink;
internal WebBrowser WebBrowserEditor;
internal ItemsControl LinkPanel;
internal TextBox HrefLink;
internal CustomItemControl DescricaoBox;
internal TextBox DescricaoLink;
private bool _contentLoaded;
public Visibility ImageVisibility
{
get
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
return (Visibility)((DependencyObject)this).GetValue(ImageVisibilityProperty);
}
set
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
((DependencyObject)this).SetValue(ImageVisibilityProperty, (object)value);
}
}
public Visibility BarVisibility
{
get
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
return (Visibility)((DependencyObject)this).GetValue(BarVisibilityProperty);
}
set
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
((DependencyObject)this).SetValue(BarVisibilityProperty, (object)value);
}
}
public string Body
{
get
{
return (string)((DependencyObject)this).GetValue(BodyProperty);
}
set
{
((DependencyObject)this).SetValue(BodyProperty, (object)value);
}
}
public bool IsReadOnly
{
get
{
return (bool)((DependencyObject)this).GetValue(IsReadOnlyProperty);
}
set
{
((DependencyObject)this).SetValue(IsReadOnlyProperty, (object)value);
}
}
public WebEditor()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
InitializeComponent();
ColorDialog = new ColorDialog();
}
private void SettingsBold_Click(object sender, RoutedEventArgs e)
{
WebBrowserEditor.HtmlDocument?.execCommand("Bold", showUI: false, Type.Missing);
}
private void SettingsItalic_Click(object sender, RoutedEventArgs e)
{
WebBrowserEditor.HtmlDocument?.execCommand("Italic", showUI: false, Type.Missing);
}
private void SettingsUnderLine_Click(object sender, RoutedEventArgs e)
{
WebBrowserEditor.HtmlDocument?.execCommand("Underline", showUI: false, Type.Missing);
}
private void SettingsRightAlign_Click(object sender, RoutedEventArgs e)
{
WebBrowserEditor.HtmlDocument?.execCommand("JustifyRight", showUI: false, Type.Missing);
}
private void SettingsLeftAlign_Click(object sender, RoutedEventArgs e)
{
WebBrowserEditor.HtmlDocument?.execCommand("JustifyLeft", showUI: false, Type.Missing);
}
private void SettingsCenter_Click(object sender, RoutedEventArgs e)
{
WebBrowserEditor.HtmlDocument?.execCommand("JustifyCenter", showUI: false, Type.Missing);
}
private void SettingsJustifyFull_Click(object sender, RoutedEventArgs e)
{
WebBrowserEditor.HtmlDocument?.execCommand("JustifyFull", showUI: false, Type.Missing);
}
private void SettingsInsertOrderedList_Click(object sender, RoutedEventArgs e)
{
WebBrowserEditor.HtmlDocument?.execCommand("InsertOrderedList", showUI: false, Type.Missing);
}
private void SettingsBullets_Click(object sender, RoutedEventArgs e)
{
WebBrowserEditor.HtmlDocument?.execCommand("InsertUnorderedList", showUI: false, Type.Missing);
}
public void InsertText(string textToInsert)
{
((dynamic)WebBrowserEditor.HtmlDocument?.selection?.createRange())?.pasteHTML(textToInsert);
}
private void SettingsFontColor_Click(object sender, RoutedEventArgs e)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
WebBrowserEditor.HtmlDocument = WebBrowserEditor.Browser.Document as HTMLDocument;
if (WebBrowserEditor.HtmlDocument != null)
{
Color val = Pick();
string value = $"#{((Color)(ref val)).R:X2}{((Color)(ref val)).G:X2}{((Color)(ref val)).B:X2}";
WebBrowserEditor.HtmlDocument.execCommand("ForeColor", showUI: false, value);
}
}
public Color Pick()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Invalid comparison between Unknown and I4
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
Color result = default(Color);
ColorDialog.AllowFullOpen = true;
ColorDialog.FullOpen = true;
if ((int)((CommonDialog)ColorDialog).ShowDialog() != 1)
{
return result;
}
((Color)(ref result)).A = ColorDialog.Color.A;
((Color)(ref result)).B = ColorDialog.Color.B;
((Color)(ref result)).G = ColorDialog.Color.G;
((Color)(ref result)).R = ColorDialog.Color.R;
return result;
}
private void ComboFontFamily_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
WebBrowserEditor.HtmlDocument = WebBrowserEditor.Browser.Document as HTMLDocument;
string value = ((Selector)ComboFontFamily).SelectedItem.ToString();
WebBrowserEditor.HtmlDocument?.execCommand("FontName", showUI: false, value);
}
private void ComboFontSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
WebBrowserEditor.HtmlDocument = WebBrowserEditor.Browser.Document as HTMLDocument;
WebBrowserEditor.HtmlDocument?.execCommand("FontSize", showUI: false, ((Selector)ComboFontSize).SelectedItem);
}
private void ComboTextFormat_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
string value = ((Selector)ComboTextFormat).SelectedValue.ToString();
WebBrowserEditor.HtmlDocument = WebBrowserEditor.Browser.Document as HTMLDocument;
WebBrowserEditor.HtmlDocument?.execCommand("FormatBlock", showUI: false, value);
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
if (WebBrowserEditor.Browser == null)
{
WebBrowserEditor.InstanciateNew();
}
FontFamilyInitialize();
FontSizeInitialize();
FontFormatInitialize();
}
private void FontFamilyInitialize()
{
((ItemsControl)ComboFontFamily).ItemsSource = Fonts.SystemFontFamilies;
ComboFontFamily.Text = "Times New Roman";
}
private void FontFormatInitialize()
{
((ItemsControl)ComboTextFormat).ItemsSource = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>("<p>", "Parágrafo"),
new KeyValuePair<string, string>("<h1>", "Título 1"),
new KeyValuePair<string, string>("<h2>", "Título 2"),
new KeyValuePair<string, string>("<h3>", "Título 3"),
new KeyValuePair<string, string>("<h4>", "Título 4"),
new KeyValuePair<string, string>("<h5>", "Título 5"),
new KeyValuePair<string, string>("<h6>", "Título 6"),
new KeyValuePair<string, string>("<address>", "Endereço"),
new KeyValuePair<string, string>("<pre>", "Pré-formatação")
};
((Selector)ComboTextFormat).SelectedValuePath = "Key";
((ItemsControl)ComboTextFormat).DisplayMemberPath = "Value";
((Selector)ComboTextFormat).SelectedIndex = 0;
}
public string GetHtml()
{
string innerHTML = WebBrowserEditor.HtmlDocument.documentElement.innerHTML;
innerHTML = innerHTML.Replace("about:", string.Empty);
return HtmlDecode(innerHTML);
}
public string GetText()
{
if (!(WebBrowserEditor.HtmlDocument.documentElement.innerText.Trim() == "new"))
{
return WebBrowserEditor.HtmlDocument.documentElement.innerText;
}
return "";
}
public string HtmlDecode(string html)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Expected O, but got Unknown
if (html == null)
{
return null;
}
HtmlDocument val = new HtmlDocument();
val.LoadHtml(html);
val.OptionWriteEmptyNodes = true;
DecodeNode(val.DocumentNode);
return val.DocumentNode.InnerHtml;
}
private void DecodeNode(HtmlNode node)
{
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Invalid comparison between Unknown and I4
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Invalid comparison between Unknown and I4
if (node.HasChildNodes)
{
foreach (HtmlNode item in (IEnumerable<HtmlNode>)node.ChildNodes)
{
if ((int)item.NodeType == 3)
{
item.InnerHtml = WebUtility.HtmlDecode(item.InnerHtml);
}
else
{
DecodeNode(item);
}
}
return;
}
if ((int)node.NodeType == 3)
{
node.InnerHtml = WebUtility.HtmlDecode(node.InnerHtml);
}
}
public void Initialize(string htmlData = null)
{
WebBrowserEditor.InstanciateNew(htmlData);
}
private void FontSizeInitialize()
{
List<string> list = new List<string>();
for (int i = 1; i <= 7; i++)
{
list.Add(i.ToString());
}
((ItemsControl)ComboFontSize).ItemsSource = list;
ComboFontSize.Text = "3";
}
private void SettingsImage_Click(object sender, RoutedEventArgs e)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
OpenFileDialog val = new OpenFileDialog
{
Title = "Selecione a imagem",
Filter = "Todos os formatos|*.jpg;*.jpeg;*.png|JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|Portable Network Graphic (*.png)|*.png"
};
if (((CommonDialog)val).ShowDialog().GetValueOrDefault())
{
string text = Path.GetExtension(((FileDialog)val).FileName).ToLower().Substring(1);
string text2 = Convert.ToBase64String(File.ReadAllBytes(((FileDialog)val).FileName));
string text3 = "data:image/" + text + ";base64," + text2;
object obj = WebBrowserEditor.HtmlDocument?.selection?.createRange();
string text4 = "<img alt=\"Imagem\" src=\"" + text3 + "\">";
if (!string.IsNullOrEmpty(ImagemLink.Text.Trim()))
{
text4 = "<a href=\"" + ImagemLink.Text + "\">" + text4 + "</a>";
}
((dynamic)obj)?.pasteHTML(text4);
}
}
private static void OnBoundBodyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
string htmlData = (string)((DependencyPropertyChangedEventArgs)(ref e)).NewValue;
if (d != null && d is WebEditor webEditor)
{
webEditor.WebBrowserEditor.InstanciateNew(htmlData);
}
}
private static void OnBoundReadOnlyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
bool flag = (bool)((DependencyPropertyChangedEventArgs)(ref e)).NewValue;
if (d != null && d is WebEditor webEditor)
{
webEditor.WebBrowserEditor.ReadOnly(flag);
((UIElement)webEditor.PanelControls).IsEnabled = !flag;
}
}
private void SettingsLink_OnClick(object sender, RoutedEventArgs e)
{
HTMLDocument htmlDocument = WebBrowserEditor.HtmlDocument;
((UIElement)DescricaoBox).Visibility = (Visibility)0;
IHTMLSelectionObject selection = htmlDocument.selection;
if (selection != null && selection.createRange() is IHTMLTxtRange iHTMLTxtRange)
{
((UIElement)DescricaoBox).Visibility = (Visibility)((!string.IsNullOrEmpty(iHTMLTxtRange.htmlText)) ? 2 : 0);
}
((UIElement)LinkPanel).Visibility = (Visibility)0;
((UIElement)WebBrowserEditor).Visibility = (Visibility)1;
}
private void InsertLink_OnClick(object sender, RoutedEventArgs e)
{
if (string.IsNullOrWhiteSpace(HrefLink.Text))
{
return;
}
IHTMLSelectionObject selection = WebBrowserEditor.HtmlDocument.selection;
if (selection != null && selection.createRange() is IHTMLTxtRange iHTMLTxtRange)
{
if (!string.IsNullOrEmpty(iHTMLTxtRange.htmlText))
{
iHTMLTxtRange.pasteHTML("<a href=\"" + HrefLink.Text + "\">" + iHTMLTxtRange.htmlText + "</a>");
}
else
{
iHTMLTxtRange.pasteHTML("<a href=\"" + HrefLink.Text + "\">" + DescricaoLink.Text + "</a>");
}
}
((UIElement)LinkPanel).Visibility = (Visibility)2;
((UIElement)WebBrowserEditor).Visibility = (Visibility)0;
}
private void CancelLink_OnClick(object sender, RoutedEventArgs e)
{
((UIElement)LinkPanel).Visibility = (Visibility)2;
((UIElement)WebBrowserEditor).Visibility = (Visibility)0;
}
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent()
{
if (!_contentLoaded)
{
_contentLoaded = true;
Uri uri = new Uri("/Gestor.Application;component/componentes/webeditor.xaml", UriKind.Relative);
Application.LoadComponent((object)this, uri);
}
}
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
internal Delegate _CreateDelegate(Type delegateType, string handler)
{
return Delegate.CreateDelegate(delegateType, this, handler);
}
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
void IComponentConnector.Connect(int connectionId, object target)
{
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Expected O, but got Unknown
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Expected O, but got Unknown
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Expected O, but got Unknown
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Expected O, but got Unknown
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Expected O, but got Unknown
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Expected O, but got Unknown
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: Expected O, but got Unknown
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Expected O, but got Unknown
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Expected O, but got Unknown
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Expected O, but got Unknown
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Expected O, but got Unknown
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Expected O, but got Unknown
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Expected O, but got Unknown
//IL_0163: Unknown result type (might be due to invalid IL or missing references)
//IL_016d: Expected O, but got Unknown
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Expected O, but got Unknown
//IL_0187: Unknown result type (might be due to invalid IL or missing references)
//IL_0191: Expected O, but got Unknown
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_019e: Expected O, but got Unknown
//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
//IL_01b5: Expected O, but got Unknown
//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Expected O, but got Unknown
//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
//IL_01d9: Expected O, but got Unknown
//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
//IL_01e6: Expected O, but got Unknown
//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
//IL_01fd: Expected O, but got Unknown
//IL_0200: Unknown result type (might be due to invalid IL or missing references)
//IL_020a: Expected O, but got Unknown
//IL_0217: Unknown result type (might be due to invalid IL or missing references)
//IL_0221: Expected O, but got Unknown
//IL_0224: Unknown result type (might be due to invalid IL or missing references)
//IL_022e: Expected O, but got Unknown
//IL_023b: Unknown result type (might be due to invalid IL or missing references)
//IL_0245: Expected O, but got Unknown
//IL_0248: Unknown result type (might be due to invalid IL or missing references)
//IL_0252: Expected O, but got Unknown
//IL_025f: Unknown result type (might be due to invalid IL or missing references)
//IL_0269: Expected O, but got Unknown
//IL_026c: Unknown result type (might be due to invalid IL or missing references)
//IL_0276: Expected O, but got Unknown
//IL_0283: Unknown result type (might be due to invalid IL or missing references)
//IL_028d: Expected O, but got Unknown
//IL_0290: Unknown result type (might be due to invalid IL or missing references)
//IL_029a: Expected O, but got Unknown
//IL_029c: Unknown result type (might be due to invalid IL or missing references)
//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
//IL_02b2: Expected O, but got Unknown
//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
//IL_02cc: Expected O, but got Unknown
//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
//IL_02da: Unknown result type (might be due to invalid IL or missing references)
//IL_02e4: Expected O, but got Unknown
//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
//IL_02f1: Expected O, but got Unknown
//IL_0301: Unknown result type (might be due to invalid IL or missing references)
//IL_030b: Expected O, but got Unknown
//IL_030d: Unknown result type (might be due to invalid IL or missing references)
//IL_0319: Unknown result type (might be due to invalid IL or missing references)
//IL_0323: Expected O, but got Unknown
switch (connectionId)
{
case 1:
((FrameworkElement)(WebEditor)target).Loaded += new RoutedEventHandler(Window_Loaded);
break;
case 2:
PanelControls = (WrapPanel)target;
break;
case 3:
ComboTextFormat = (ComboBox)target;
((Selector)ComboTextFormat).SelectionChanged += new SelectionChangedEventHandler(ComboTextFormat_SelectionChanged);
break;
case 4:
ComboFontFamily = (ComboBox)target;
((Selector)ComboFontFamily).SelectionChanged += new SelectionChangedEventHandler(ComboFontFamily_SelectionChanged);
break;
case 5:
ComboFontSize = (ComboBox)target;
((Selector)ComboFontSize).SelectionChanged += new SelectionChangedEventHandler(ComboFontSize_SelectionChanged);
break;
case 6:
SettingsBold = (Button)target;
((ButtonBase)SettingsBold).Click += new RoutedEventHandler(SettingsBold_Click);
break;
case 7:
SettingsItalic = (Button)target;
((ButtonBase)SettingsItalic).Click += new RoutedEventHandler(SettingsItalic_Click);
break;
case 8:
SettingsUnderLine = (Button)target;
((ButtonBase)SettingsUnderLine).Click += new RoutedEventHandler(SettingsUnderLine_Click);
break;
case 9:
SettingsFontColor = (Button)target;
((ButtonBase)SettingsFontColor).Click += new RoutedEventHandler(SettingsFontColor_Click);
break;
case 10:
SettingsBullets = (Button)target;
((ButtonBase)SettingsBullets).Click += new RoutedEventHandler(SettingsBullets_Click);
break;
case 11:
SettingsNumbered = (Button)target;
((ButtonBase)SettingsNumbered).Click += new RoutedEventHandler(SettingsInsertOrderedList_Click);
break;
case 12:
SettingsLeftAlign = (Button)target;
((ButtonBase)SettingsLeftAlign).Click += new RoutedEventHandler(SettingsLeftAlign_Click);
break;
case 13:
SettingsCenter = (Button)target;
((ButtonBase)SettingsCenter).Click += new RoutedEventHandler(SettingsCenter_Click);
break;
case 14:
SettingsRightAlign = (Button)target;
((ButtonBase)SettingsRightAlign).Click += new RoutedEventHandler(SettingsRightAlign_Click);
break;
case 15:
SettingsJustifyFull = (Button)target;
((ButtonBase)SettingsJustifyFull).Click += new RoutedEventHandler(SettingsJustifyFull_Click);
break;
case 16:
SettingsLink = (Button)target;
((ButtonBase)SettingsLink).Click += new RoutedEventHandler(SettingsLink_OnClick);
break;
case 17:
ImagemLink = (TextBox)target;
break;
case 18:
((MenuItem)target).Click += new RoutedEventHandler(SettingsImage_Click);
break;
case 19:
WebBrowserEditor = (WebBrowser)target;
break;
case 20:
LinkPanel = (ItemsControl)target;
break;
case 21:
((ButtonBase)(Button)target).Click += new RoutedEventHandler(CancelLink_OnClick);
break;
case 22:
HrefLink = (TextBox)target;
break;
case 23:
DescricaoBox = (CustomItemControl)target;
break;
case 24:
DescricaoLink = (TextBox)target;
break;
case 25:
((ButtonBase)(Button)target).Click += new RoutedEventHandler(InsertLink_OnClick);
break;
default:
_contentLoaded = true;
break;
}
}
}
|