-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTextBoxComponent.razor.cs
2380 lines (2127 loc) · 76.7 KB
/
TextBoxComponent.razor.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
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
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#region using statements
using DataJuggler.Blazor.Components.Enumerations;
using DataJuggler.Blazor.Components.Interfaces;
using DataJuggler.UltimateHelper;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using System;
using System.Drawing;
using System.Threading.Tasks;
using DataJuggler.Blazor.Components.Delegates;
using NPOI.SS.UserModel;
#endregion
namespace DataJuggler.Blazor.Components
{
#region class TextBoxComponent : IBlazorComponent
/// <summary>
/// The validation component is just a way to display a valid or not valid to make the UI
/// appear different.
/// </summary>
public partial class TextBoxComponent : IBlazorComponent, ILabelFont, ITextBoxFont
{
#region Private Variables
private string bottomMarginStyle;
private double borderWidth;
private string borderColor;
private string caption;
private double fontSize;
private string fontName;
private double height;
private string imageClassName;
private bool isValid;
private string text;
private string inputType;
private bool isRequired;
private bool isIntegerRequired;
private bool isDoubleRequired;
private bool isUnique;
private bool loading;
private int minimumLength;
private int maximumLength;
private int minimumInteger;
private int maximumInteger;
private int minimumDouble;
private int maximumDouble;
private bool multiline;
private string validationMessage;
private string invalidReason;
private bool isUniqueCallbackRequired;
private string uniqueImageUrl;
private string takenImageUrl;
private string imageUrl;
private bool passwordMode;
private bool showImage;
private double imageScale;
private double width;
private string name;
private double left;
private double top;
private bool formatAsPhoneNumber;
private string position;
private IBlazorComponentParent parent;
private string className;
private bool setFocusOnFirstRender;
private bool showCaption;
private int externalId;
private string externalIdDescription;
private ElementReference innerControl;
private bool visible;
private string display;
private bool sendAllTextToParent;
private string fontSizeUnit;
private string backgroundColor;
private double imageWidth;
private string imageBackColor;
private double marginLeft;
private int rows;
private double column1Width;
private double column2Width;
private double column3Width;
private bool enabled;
private double marginBottom;
private bool autoComplete;
private string invalidLabelColor;
private string pattern;
private int tabIndex;
private string column1Style;
private string column2Style;
private string column3Style;
private string imageStyle;
private OnTextChange onTextChangedCallback;
private HandleChangeEnum handleChangeOption;
private int zIndex;
private string unit;
private string heightUnit;
private bool notifyParentOnBlur;
// Label
private double labelWidth;
private double labelFontSize;
private string labelFontName;
private string labelClassName;
private string labelBackgroundColor;
private string labelColor;
private double labelTop;
private double labelLeft;
private string labelStyle;
// TextBox
private string textBoxBackColor;
private string textBoxTextColor;
private string textBoxClassName;
private double textBoxWidth;
private string textBoxControlStyle;
private string textBoxStyle;
private double textBoxFontSize;
private string textBoxFontName;
// This are only used when inside a Grid
private Guid rowId;
private Guid columnId;
#endregion
#region Constructor
/// <summary>
/// Create a new instance of a TextBoxComponent object
/// </summary>
public TextBoxComponent()
{
// Perform initializations for this object
Init();
}
#endregion
#region Events
#region HandleChange(ChangeEventArgs e)
/// <summary>
/// event is fired when Handle Change
/// </summary>
private void HandleChange(ChangeEventArgs e)
{
// get the current text
string text = e.Value.ToString();
// if the value for HasOnTextChangedCallback is true
if (HasOnTextChangedCallback)
{
// Notify Subscriber
OnTextChangedCallback(text);
}
}
#endregion
#region OnAfterRenderAsync(bool firstRender)
/// <summary>
/// This method is used to verify a user
/// </summary>
/// <param name="firstRender"></param>
/// <returns></returns>
protected async override Task OnAfterRenderAsync(bool firstRender)
{
try
{
if (SetFocusOnFirstRender && firstRender)
{
// Set Focus
SetFocus();
}
}
catch (Exception error)
{
// Attempt to trap
DebugHelper.WriteDebugError("OnAfterRenderAsync", "Grid.razor.cs", error);
}
// call the base
await base.OnAfterRenderAsync(firstRender);
}
#endregion
#endregion
#region Methods
#region Enter(KeyboardEventArgs e)
/// <summary>
/// event is fired when Enter
/// </summary>
public void Enter(KeyboardEventArgs e)
{
if (e.Code == "Enter" || e.Code == "NumpadEnter")
{
// if the value for FormatAsPhoneNumber is true
if (FormatAsPhoneNumber)
{
// Handle Blue which sets the text to (xxx) xxx - xxxx
HandleBlur();
}
// if the Parent exists
if (HasParent)
{
// Inform the Parent
SendMessageToParent("EnterPressed");
}
}
else if (e.Code == "Escape")
{
// Inform the Parent Escape was hit
SendMessageToParent("EscapePressed");
}
// if SendAllTextToParent
if (SendAllTextToParent)
{
// Send to the parent
SendMessageToParent("text: " + e.Code, e.Code);
}
}
#endregion
#region HandleBlur()
/// <summary>
/// method Handle Blur
/// </summary>
private void HandleBlur()
{
// if the value for FormatAsPhoneNumber is true
if (FormatAsPhoneNumber)
{
// Update the Text
Text = TextHelper.FormatPhoneNumber(Text);
}
// if the value for NotifyParentOnBlur is true
if ((HasParent) && (NotifyParentOnBlur))
{
Message message = new Message();
message.Sender = this;
message.Text = "OnBlurFired";
// Notify the parent
parent.ReceiveData(message);
}
}
#endregion
#region Init()
/// <summary>
/// This method This method performs initializations for this object.
/// </summary>
public void Init()
{
// Set Default Values
AutoComplete = false;
Caption = "";
BackgroundColor = "transparent";
Display = "inline-block";
InputType = "text";
LabelColor = "Black";
IsUnique = true;
ImageScale = 1.6;
TextBoxWidth = GlobalDefaults.TextBoxWidth;
Height = 22;
Unit = "px";
FontSize = GlobalDefaults.TextBoxFontSize;
FontName = GlobalDefaults.TextBoxFontName;
FontSizeUnit="px";
HeightUnit = "px";
ImageBackColor = "transparent";
ImageWidth = 10;
InvalidLabelColor = "Tomato";
LabelBackgroundColor = "transparent";
LabelColor="Black";
LabelWidth= 30;
LabelFontSize = GlobalDefaults.LabelFontSize;
LabelFontName = GlobalDefaults.LabelFontName;
Left = 0;
MarginLeft = 1.2;
MarginBottom = 8;
Position = "relative";
TakenImageUrl = "_content/BlazorComponentsTutorial/Images/Failure.png";
Text = "";
Top = 0;
UniqueImageUrl = "_content/BlazorComponentsTutorial/Images/Success.png";
LabelClassName = GlobalDefaults.LabelClassName;
Column1Width = GlobalDefaults.Column1Width;
Column2Width = GlobalDefaults.Column2Width;
Column3Width = GlobalDefaults.Column3Width;
Rows = 3;
Visible = true;
Width= 80;
Enabled = true;
BorderWidth = 1;
BorderColor = "black";
HandleChangeOption = HandleChangeEnum.OnKeyDown;
TextBoxBackColor = "white";
TextBoxTextColor = "black";
TextBoxFontSize = GlobalDefaults.TextBoxFontSize;
TextBoxFontName = GlobalDefaults.TextBoxFontName;
}
#endregion
#region ReceiveData(Message message)
/// <summary>
/// method returns the Data
/// </summary>
public void ReceiveData(Message message)
{
// if a message exists
if (NullHelper.Exists(message))
{
// if Taken
if ((TextHelper.IsEqual(message.Text, "Taken")) && (HasTakenImageUrl))
{
// Set the ImageUrl
ImageUrl = TakenImageUrl;
// Set to true
ShowImage = true;
// not valid because it is not unique
IsUnique = false;
// Not valid here
IsValid = false;
}
// if Available
else if ((TextHelper.IsEqual(message.Text, "Available")) && (HasUniqueImageUrl))
{
// Set the ImageUrl
ImageUrl = UniqueImageUrl;
// this is unique
isUnique = true;
// Set to true
ShowImage = true;
// Is valid here
IsValid = true;
}
// if the value for ShowImage is true
if (ShowImage)
{
// if there are parameters
if (ListHelper.HasOneOrMoreItems(message.Parameters))
{
// if a ValidationMessage was passed in with it
if (message.Parameters[0].Name == "Validation Message")
{
if (NullHelper.Exists(message.Parameters[0].Value))
{
// Use the Validation Message passed in
ValidationMessage = message.Parameters[0].Value.ToString();
}
}
}
// Refresh
Refresh();
}
}
}
#endregion
#region Refresh()
/// <summary>
/// method Refresh
/// </summary>
public void Refresh()
{
// Update the UI
InvokeAsync(() =>
{
StateHasChanged();
});
}
#endregion
#region SendMessageToParent(string messageText, string keyCode = "")
/// <summary>
/// Sends a Message To the Parent
/// </summary>
public void SendMessageToParent(string messageText, string keyCode = "")
{
// if the value for HasParent is true
if (HasParent)
{
// Create a message
Message message = new Message();
// Set the message text
message.Text = messageText;
// Set the Sender
message.Sender = this;
// Send the KeyCode
message.KeyCode = keyCode;
// Create a new instance of a 'NamedParameter' object.
NamedParameter parameter = new NamedParameter();
// Set the name of the object calling
parameter.Name = this.Name;
// if the value for HasParentGrid is true
if (HasParentGrid)
{
// Send in the Ids to help find what was just saved
parameter.ColumnId = ColumnId;
parameter.RowId = RowId;
parameter.GridName = ParentGrid.Name;
}
// 12.11.2022: Added these to provide more info to clients.
parameter.ExternalId = ExternalId;
parameter.ExternalIdDescription = ExternalIdDescription;
// Set the value
parameter.Value = Text;
// Add this parameter
message.Parameters.Add(parameter);
// notify the parent
Parent.ReceiveData(message);
}
}
#endregion
#region SetBackgroundColor(Color color)
/// <summary>
/// Set Background Color
/// </summary>
public void SetBackgroundColor(Color color)
{
// Set the BackgroundColor
BackgroundColor = color.Name;
}
#endregion
#region SetClassName(string className, bool refresh)
/// <summary>
/// Set Class Name
/// </summary>
public void SetClassName(string newClassName, bool refresh)
{
// Set the ClassName
ClassName = newClassName;
// if the value for refresh is true
if (refresh)
{
// Set to Refresh
Refresh();
}
}
#endregion
#region SetEnabled(bool enable)
/// <summary>
/// Set Enabled
/// </summary>
public void SetEnabled(bool enable)
{
// store
Enabled = enable;
}
#endregion
#region SetFocus()
/// <summary>
/// method Set Focus
/// </summary>
public async void SetFocus()
{
try
{
// Set focus to the control
await InnerControl.FocusAsync();
}
catch (Exception error)
{
// for debugging only for now
DebugHelper.WriteDebugError("SetFocus", "TextBoxComponent.cs", error);
}
}
#endregion
#region SetInputType()
/// <summary>
/// This method Set Input Type
/// </summary>
public void SetInputType()
{
// default
inputType = "text";
// if the value for PasswordMode is true
if (PasswordMode)
{
// Set the InputType
inputType = "password";
}
}
#endregion
#region SetInvalidLabelColor(string invalidColor)
/// <summary>
/// Set Invalid Label Color
/// </summary>
public void SetInvalidLabelColor(string invalidColor)
{
// Set the color to be set for invalid
InvalidLabelColor = invalidColor;
}
#endregion
#region SetLabelClassName(string labelClass)
/// <summary>
/// Set Label Class Name
/// </summary>
public void SetLabelClassName(string labelClass)
{
// Store
LabelClassName = labelClass;
}
#endregion
#region SetLabelColor()
/// <summary>
/// Set Label Color
/// </summary>
public void SetLabelColor(string color)
{
// Store
LabelColor = color;
}
#endregion
#region SetTextBoxBackColor(Color color)
/// <summary>
/// Set Text Box Back Color
/// </summary>
public void SetTextBoxBackColor(Color color)
{
// Set the Color
TextBoxBackColor = color.Name;
}
#endregion
#region SetTextBoxTextColor(string color)
/// <summary>
/// Set Text Box Text Color
/// </summary>
public void SetTextBoxTextColor(string color)
{
// Store
TextBoxTextColor = color;
}
#endregion
#region SetTextValue(string text)
/// <summary>
/// This method Sets the Text Value
/// </summary>
public void SetTextValue(string text)
{
// Set the value
this.Text = text;
}
#endregion
#region Validate()
/// <summary>
/// This method Validate
/// </summary>
public bool Validate()
{
// initial value (Defaulting to true)
bool isValid = true;
// if an integer value is required
if (IsIntegerRequired)
{
// to do: Do this some day
}
else if (IsDoubleRequired)
{
// to do: Do this some day
}
// if this is required
else if (isRequired)
{
// set isValid to true if there is any text
isValid = TextHelper.Exists(Text);
// if a Minimum or MaximumLength is set
if ((isValid) && (MinimumLength > 0) || (MaximumLength > 0))
{
// if a MinimumLength is required
if ((MinimumLength > 0) && (Text.Length < MinimumLength))
{
// not valid
isValid = false;
}
// if a MaximumLength is required
if ((MaximumLength > 0) && (Text.Length > MaximumLength))
{
// not valid
isValid = false;
}
}
// if a UniqueCallback is required
if ((isValid) && (IsUniqueCallbackRequired) && (HasParent))
{
// Create a new instance of a 'Message' object.
Message message = new Message();
// Set the Text
message.Text = "Check Unique";
// Create a new instance of a 'NamedParameter' object.
NamedParameter instructionParameter = new NamedParameter();
// Set the name & Value
instructionParameter.Name = Caption;
instructionParameter.Value = Text;
// Add this parameter
message.Parameters.Add(instructionParameter);
// Send the parent a message
Parent.ReceiveData(message);
}
// if not unique, not valid
if (!IsUnique)
{
// not valid if alse
isValid = false;
// Set the validiation message
this.ValidationMessage = "This " + this.Caption.Replace(":", "") + " is already taken. Please login if this is you.";
}
// Set the value
this.IsValid = isValid;
}
// if the value for IsValid is false
if (!isValid)
{
// Set the reason
InvalidReason = ValidationMessage;
}
// return value
return isValid;
}
#endregion
#endregion
#region Properties
#region AutoComplete
/// <summary>
/// This property gets or sets the value for 'Autocomplete'.
/// </summary>
[Parameter]
public bool AutoComplete
{
get { return autoComplete; }
set { autoComplete = value; }
}
#endregion
#region AutoCompleteStyle
/// <summary>
/// This read only property returns the value of AutoCompleteStyle from the object AutoComplete.
/// </summary>
public string AutoCompleteStyle
{
get
{
// initial value
string autoCompleteStyle = "off";
if (AutoComplete)
{
// Set to On if AutoComplete is truned on.
autoCompleteStyle = "on";
}
// return value
return autoCompleteStyle;
}
}
#endregion
#region BackgroundColor
/// <summary>
/// This property gets or sets the value for 'BackgroundColor'.
/// </summary>
[Parameter]
public string BackgroundColor
{
get { return backgroundColor; }
set { backgroundColor = value; }
}
#endregion
#region BorderColor
/// <summary>
/// This property gets or sets the value for 'BorderColor'.
/// </summary>
[Parameter]
public string BorderColor
{
get { return borderColor; }
set { borderColor = value; }
}
#endregion
#region BorderWidth
/// <summary>
/// This property gets or sets the value for 'BorderWidth'.
/// </summary>
[Parameter]
public double BorderWidth
{
get { return borderWidth; }
set { borderWidth = value; }
}
#endregion
#region BorderWidthStyle
/// <summary>
/// This read only property returns the value of BorderWidth + Unit;
/// </summary>
public string BorderWidthStyle
{
get
{
// initial value
string borderWidthStyle = BorderWidth + Unit;
// return value
return borderWidthStyle;
}
}
#endregion
#region BottomMarginStyle
/// <summary>
/// This property gets or sets the value for 'BottomMarginStyle'.
/// </summary>
public string BottomMarginStyle
{
get { return bottomMarginStyle; }
set { bottomMarginStyle = value; }
}
#endregion
#region Caption
/// <summary>
/// This property gets or sets the value for 'Caption'.
/// </summary>
[Parameter]
public string Caption
{
get { return caption; }
set
{
// set the value
caption = value;
// Show the Caption, if the Caption is set.
ShowCaption = TextHelper.Exists(caption);
}
}
#endregion
#region ClassName
/// <summary>
/// This property gets or sets the value for 'ClassName'.
/// </summary>
[Parameter]
public string ClassName
{
get { return className; }
set { className = value; }
}
#endregion
#region Column1Style
/// <summary>
/// This property gets or sets the value for 'Column1Style'.
/// </summary>
public string Column1Style
{
get { return column1Style; }
set { column1Style = value; }
}
#endregion
#region Column1Width
/// <summary>
/// This property gets or sets the value for 'Column1Width'.
/// </summary>
[Parameter]
public double Column1Width
{
get { return column1Width; }
set { column1Width = value; }
}
#endregion
#region Column1WidthStyle
/// <summary>
/// This read only property returns the value of Column1Width + Unit
/// </summary>
public string Column1WidthStyle
{
get
{
// initial value
string column1WidthStyle = Column1Width + Unit;
// return value
return column1WidthStyle;
}
}
#endregion
#region Column2Style
/// <summary>
/// This property gets or sets the value for 'Column2Style'.
/// </summary>
public string Column2Style
{
get { return column2Style; }
set { column2Style = value; }
}
#endregion
#region Column2Width
/// <summary>
/// This property gets or sets the value for 'Column2Width'.
/// </summary>
[Parameter]
public double Column2Width
{
get { return column2Width; }
set { column2Width = value; }
}
#endregion
#region Column2WidthStyle
/// <summary>
/// This read only property returns the value of Column2Width + Unit
/// </summary>
public string Column2WidthStyle
{
get
{
// initial value
string column2WidthStyle = Column2Width + Unit;
// return value
return column2WidthStyle;
}
}
#endregion
#region Column3Style
/// <summary>
/// This property gets or sets the value for 'Column3Style'.
/// </summary>
public string Column3Style
{
get { return column3Style; }
set { column3Style = value; }
}
#endregion
#region Column3Width
/// <summary>
/// This property gets or sets the value for 'Column3Width'.
/// </summary>
[Parameter]
public double Column3Width
{
get { return column3Width; }
set { column3Width = value; }
}
#endregion
#region Column3WidthStyle
/// <summary>
/// This read only property returns the value of Column3Width + Unit
/// </summary>
public string Column3WidthStyle
{
get
{
// initial value
string column3WidthStyle = Column3Width + Unit;
// return value
return column3WidthStyle;
}
}
#endregion
#region ColumnId
/// <summary>
/// This property gets or sets the value for 'ColumnId'.
/// </summary>
[Parameter]
public Guid ColumnId
{
get { return columnId; }
set { columnId = value; }
}
#endregion
#region Display
/// <summary>
/// This property gets or sets the value for 'Display'.
/// This property will be used, unless Visible = false, then DisplayNone will be used.
/// </summary>
[Parameter]
public string Display
{
get { return display; }
set { display = value; }
}
#endregion
#region DisplayStyle
/// <summary>
/// This read only property returns the value of Display, unless Visible = false.
/// </summary>
public string DisplayStyle
{
get
{
// initial value
string displayStyle = "";
// if the value for Visible is true
if (Visible)
{
// set the return value
displayStyle = Display;
}
else
{
// Invisible
displayStyle = "none";
}
// return value
return displayStyle;
}
}
#endregion
#region Enabled
/// <summary>
/// This property gets or sets the value for 'Enabled'.
/// </summary>
[Parameter]
public bool Enabled
{
get { return enabled; }
set { enabled = value; }
}
#endregion