diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-12-07 04:32:57 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-12-07 04:32:57 +0100 |
| commit | fd3cf7597b2c3084c41993fe2043a484466c4fa9 (patch) | |
| tree | 7e5ccf6829bf555eb4720a5c7593237caaa0ac5c /src/GraphicObjects | |
| parent | d8e417769988c76a7ebe9adc85c929e815583683 (diff) | |
debug for netcore standards 2
Diffstat (limited to 'src/GraphicObjects')
33 files changed, 158 insertions, 123 deletions
diff --git a/src/GraphicObjects/Border.cs b/src/GraphicObjects/Border.cs index 63f2c68f..9379c26a 100644 --- a/src/GraphicObjects/Border.cs +++ b/src/GraphicObjects/Border.cs @@ -62,7 +62,7 @@ namespace Crow /// <summary> /// use to define the colors of the 3d border /// </summary> - [XmlAttributeAttribute] + public virtual Fill RaisedColor { get { return raisedColor; } set { @@ -76,7 +76,7 @@ namespace Crow /// <summary> /// use to define the colors of the 3d border /// </summary> - [XmlAttributeAttribute] + public virtual Fill SunkenColor { get { return sunkenColor; } set { @@ -90,7 +90,7 @@ namespace Crow /// <summary> /// border width in pixels /// </summary> - [XmlAttributeAttribute()][DefaultValue(1)] + [DefaultValue(1)] public virtual int BorderWidth { get { return _borderWidth; } set { @@ -101,7 +101,7 @@ namespace Crow /// <summary> /// allow 3d border effects /// </summary> - [XmlAttributeAttribute][DefaultValue(BorderStyle.Normal)] + [DefaultValue(BorderStyle.Normal)] public virtual BorderStyle BorderStyle { get { return _borderStyle; } set { diff --git a/src/GraphicObjects/Button.cs b/src/GraphicObjects/Button.cs index 8b60dcb9..30612512 100644 --- a/src/GraphicObjects/Button.cs +++ b/src/GraphicObjects/Button.cs @@ -75,7 +75,7 @@ namespace Crow } #endregion - [XmlAttributeAttribute][DefaultValue("#Crow.Images.button.svg")] + [DefaultValue("#Crow.Images.button.svg")] public string Image { get { return image; } set { @@ -85,7 +85,7 @@ namespace Crow NotifyValueChanged ("Image", image); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public bool IsPressed { get { return isPressed; } diff --git a/src/GraphicObjects/CheckBox.cs b/src/GraphicObjects/CheckBox.cs index 646a8577..4860d604 100644 --- a/src/GraphicObjects/CheckBox.cs +++ b/src/GraphicObjects/CheckBox.cs @@ -45,7 +45,7 @@ namespace Crow public event EventHandler Checked; public event EventHandler Unchecked; - [XmlAttributeAttribute()][DefaultValue(false)] + [DefaultValue(false)] public bool IsChecked { get { return isChecked; } diff --git a/src/GraphicObjects/ColorPicker.cs b/src/GraphicObjects/ColorPicker.cs index cc955191..dd45023c 100644 --- a/src/GraphicObjects/ColorPicker.cs +++ b/src/GraphicObjects/ColorPicker.cs @@ -46,7 +46,7 @@ namespace Crow Color curColor; double h,s,v; - [XmlAttributeAttribute()] + public virtual double R { get { return Math.Round(curColor.R * div); } set { @@ -58,7 +58,7 @@ namespace Crow notifyCurColorHasChanged (); } } - [XmlAttributeAttribute()] + public virtual double G { get { return Math.Round(curColor.G * div); } set { @@ -70,7 +70,7 @@ namespace Crow hsvFromRGB (); } } - [XmlAttributeAttribute()] + public virtual double B { get { return Math.Round(curColor.B * div); } set { @@ -82,7 +82,7 @@ namespace Crow hsvFromRGB (); } } - [XmlAttributeAttribute()] + public virtual double A { get { return Math.Round(curColor.A * div); } set { @@ -94,7 +94,7 @@ namespace Crow hsvFromRGB (); } } - [XmlAttributeAttribute()] + public virtual double H { get { return Math.Round (h, 3); } set { @@ -105,7 +105,7 @@ namespace Crow rgbFromHSV (); } } - [XmlAttributeAttribute()] + public virtual double S { get { return Math.Round (s, 2); } set { @@ -116,7 +116,7 @@ namespace Crow rgbFromHSV (); } } - [XmlAttributeAttribute()] + public virtual double V { get { return Math.Round (v, 2); } set { @@ -128,7 +128,7 @@ namespace Crow } } - [XmlAttributeAttribute] + public virtual Fill SelectedColor { get { return new SolidColor(curColor); } set { @@ -145,7 +145,7 @@ namespace Crow hsvFromRGB (); } } - [XmlAttributeAttribute] + public virtual Color SelectedRawColor { get { return curColor; } set { diff --git a/src/GraphicObjects/DirectoryView.cs b/src/GraphicObjects/DirectoryView.cs index d530f0cb..b0217896 100644 --- a/src/GraphicObjects/DirectoryView.cs +++ b/src/GraphicObjects/DirectoryView.cs @@ -63,7 +63,7 @@ namespace Crow NotifyValueChanged ("SelectedItem", _selectedItem); } } - [XmlAttributeAttribute()][DefaultValue(true)] + [DefaultValue(true)] public virtual bool ShowFiles { get { return showFiles; } set { @@ -74,7 +74,7 @@ namespace Crow NotifyValueChanged ("FileSystemEntries", FileSystemEntries); } } - [XmlAttributeAttribute()][DefaultValue(false)] + [DefaultValue(false)] public virtual bool ShowHidden { get { return showHidden; } set { @@ -85,7 +85,7 @@ namespace Crow NotifyValueChanged ("FileSystemEntries", FileSystemEntries); } } - [XmlAttributeAttribute][DefaultValue("*.*")] + [DefaultValue("*.*")] public virtual string FileMask { get { return fileMask; } set { @@ -96,7 +96,7 @@ namespace Crow NotifyValueChanged ("FileSystemEntries", FileSystemEntries); } } - [XmlAttributeAttribute][DefaultValue("/")] + [DefaultValue("/")] public virtual string CurrentDirectory { get { return currentDirectory; } set { diff --git a/src/GraphicObjects/Expandable.cs b/src/GraphicObjects/Expandable.cs index 1920a8fe..89bec196 100644 --- a/src/GraphicObjects/Expandable.cs +++ b/src/GraphicObjects/Expandable.cs @@ -67,7 +67,7 @@ namespace Crow } #region Public properties - [XmlAttributeAttribute][DefaultValue("#Crow.Images.Icons.expandable.svg")] + [DefaultValue("#Crow.Images.Icons.expandable.svg")] public string Image { get { return image; } set { diff --git a/src/GraphicObjects/FileDialog.cs b/src/GraphicObjects/FileDialog.cs index 8069b8a7..db66ae9e 100644 --- a/src/GraphicObjects/FileDialog.cs +++ b/src/GraphicObjects/FileDialog.cs @@ -55,7 +55,7 @@ namespace Crow public string SelectedFileFullPath { get { return Path.Combine (SelectedDirectory, SelectedFile); } } - [XmlAttributeAttribute][DefaultValue("/home")] + [DefaultValue("/home")] public virtual string CurrentDirectory { get { return curDir; } set { @@ -67,7 +67,7 @@ namespace Crow } } - [XmlAttributeAttribute][DefaultValue("*")] + [DefaultValue("*")] public virtual string SearchPattern { get { return searchPattern; } set { @@ -78,7 +78,7 @@ namespace Crow } } - [XmlAttributeAttribute()][DefaultValue(false)] + [DefaultValue(false)] public virtual bool ShowHidden { get { return showHidden; } set { @@ -88,7 +88,7 @@ namespace Crow NotifyValueChanged ("ShowHidden", showHidden); } } - [XmlAttributeAttribute()][DefaultValue(true)] + [DefaultValue(true)] public virtual bool ShowFiles { get { return showFiles; } set { @@ -98,7 +98,7 @@ namespace Crow NotifyValueChanged ("ShowFiles", showFiles); } } - [XmlAttributeAttribute]public string SelectedFile { + public string SelectedFile { get { return _selectedFile; } set { if (value == _selectedFile) @@ -107,7 +107,7 @@ namespace Crow NotifyValueChanged ("SelectedFile", _selectedFile); } } - [XmlAttributeAttribute]public string SelectedDirectory { + public string SelectedDirectory { get { return _selectedDir; } set { if (value == _selectedDir) diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs index f281311c..50c66c3e 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/src/GraphicObjects/GenericStack.cs @@ -48,7 +48,7 @@ namespace Crow #endregion #region Public Properties - [XmlAttributeAttribute()][DefaultValue(2)] + [DefaultValue(2)] public int Spacing { get { return _spacing; } @@ -60,7 +60,7 @@ namespace Crow RegisterForLayouting (LayoutingType.Sizing|LayoutingType.ArrangeChildren); } } - [XmlAttributeAttribute()][DefaultValue(Orientation.Horizontal)] + [DefaultValue(Orientation.Horizontal)] public virtual Orientation Orientation { get { return _orientation; } diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index ec4fa173..f90e06e0 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -1098,12 +1098,14 @@ namespace Crow DynamicMethod dm = null; ILGenerator il = null; - dm = new DynamicMethod("dyn_loadDefValues", + /*dm = new DynamicMethod("dyn_loadDefValues", MethodAttributes.Family | MethodAttributes.FamANDAssem | MethodAttributes.NewSlot, CallingConventions.Standard, - typeof(void),new Type[] {CompilerServices.TObject},thisType,true); + typeof(void),new Type[] {CompilerServices.TObject}, thisType, true);*/ - il = dm.GetILGenerator(256); + dm = new DynamicMethod("dyn_loadDefValues", null, new Type[] {CompilerServices.TObject}, thisType, true); + + il = dm.GetILGenerator(256); il.DeclareLocal(CompilerServices.TObject); il.Emit(OpCodes.Nop); //set local GraphicObject to root object passed as 1st argument @@ -1129,9 +1131,9 @@ namespace Crow il.Emit (OpCodes.Ldstr, trimed.Substring (1, trimed.Length - 2)); //push null as 3rd arg, currentNode, not known when instanciing il.Emit (OpCodes.Ldnull); - il.Emit (OpCodes.Callvirt, CompilerServices.miCompileDynEventHandler); + il.Emit (OpCodes.Call, CompilerServices.miCompileDynEventHandler); il.Emit (OpCodes.Castclass, ei.EventHandlerType); - il.Emit (OpCodes.Callvirt, ei.AddMethod); + il.Emit (OpCodes.Call, ei.AddMethod); }else Debug.WriteLine("error in styling, event not handled : " + trimed); } diff --git a/src/GraphicObjects/Grid.cs b/src/GraphicObjects/Grid.cs index 4ae906a7..71e89bde 100644 --- a/src/GraphicObjects/Grid.cs +++ b/src/GraphicObjects/Grid.cs @@ -56,13 +56,13 @@ namespace Crow #endregion #region Public Properties - [XmlAttributeAttribute()][DefaultValue(2)] + [DefaultValue(2)] public int Spacing { get { return _spacing; } set { _spacing = value; } } - [XmlAttributeAttribute()][DefaultValue(2)] + [DefaultValue(2)] public virtual int ColumnCount { get { return _columnCount; } @@ -76,7 +76,7 @@ namespace Crow this.RegisterForLayouting (LayoutingType.ArrangeChildren); } } - [XmlAttributeAttribute()][DefaultValue(2)] + [DefaultValue(2)] public virtual int RowCount { get { return _rowCount; } diff --git a/src/GraphicObjects/Group.cs b/src/GraphicObjects/Group.cs index ece1f090..13fdcd49 100644 --- a/src/GraphicObjects/Group.cs +++ b/src/GraphicObjects/Group.cs @@ -84,7 +84,7 @@ namespace Crow public virtual List<GraphicObject> Children { get { return children; } } - [XmlAttributeAttribute()][DefaultValue(false)] + [DefaultValue(false)] public bool MultiSelect { get { return _multiSelect; } diff --git a/src/GraphicObjects/HueSelector.cs b/src/GraphicObjects/HueSelector.cs index 67f4ec6e..d8218fee 100644 --- a/src/GraphicObjects/HueSelector.cs +++ b/src/GraphicObjects/HueSelector.cs @@ -44,7 +44,7 @@ namespace Crow Orientation _orientation; double hue; - [XmlAttributeAttribute][DefaultValue(Orientation.Horizontal)] + [DefaultValue(Orientation.Horizontal)] public virtual Orientation Orientation { get { return _orientation; } @@ -56,7 +56,7 @@ namespace Crow RegisterForGraphicUpdate (); } } - [XmlAttributeAttribute()] + public virtual double Hue { get { return hue; } set { diff --git a/src/GraphicObjects/Image.cs b/src/GraphicObjects/Image.cs index 5960101a..21a83f90 100644 --- a/src/GraphicObjects/Image.cs +++ b/src/GraphicObjects/Image.cs @@ -49,7 +49,7 @@ namespace Crow /// <summary> /// If false, original size will be kept in any case. /// </summary> - [XmlAttributeAttribute][DefaultValue(true)] + [DefaultValue(true)] public virtual bool Scaled { get { return scaled; } set { @@ -66,7 +66,7 @@ namespace Crow /// <summary> /// If image is scaled, proportions will be preserved. /// </summary> - [XmlAttributeAttribute][DefaultValue(true)] + [DefaultValue(true)] public virtual bool KeepProportions { get { return keepProps; } set { @@ -83,7 +83,7 @@ namespace Crow /// <summary> /// Image file path, may be on disk or embedded. Accepts bitmaps or SVG drawings. /// </summary> - [XmlAttributeAttribute] + public string Path { get { return _pic == null ? "" : _pic.Path; } set { @@ -108,7 +108,7 @@ namespace Crow /// Used only for svg images, repaint only node named referenced in SvgSub. /// If null, all the svg is rendered /// </summary> - [XmlAttributeAttribute] + public string SvgSub { get { return _svgSub; } set { @@ -122,7 +122,7 @@ namespace Crow /// Object holding the image data once loaded, may be used directely to pupulate this control without /// specifying a path. /// </summary> - [XmlAttributeAttribute] + public Picture Picture { get { return _pic; } set { @@ -137,7 +137,7 @@ namespace Crow /// Opacity parameter for the image /// </summary> // TODO:could be moved in GraphicObject - [XmlAttributeAttribute()][DefaultValue(1.0)] + [DefaultValue(1.0)] public virtual double Opacity { get { return opacity; } set { diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs index b3f97a2e..c8a43694 100644 --- a/src/GraphicObjects/Label.cs +++ b/src/GraphicObjects/Label.cs @@ -87,8 +87,7 @@ namespace Crow protected TextExtents te; #endregion - - [XmlAttributeAttribute][DefaultValue("SteelBlue")] + [DefaultValue("SteelBlue")] public virtual Color SelectionBackground { get { return selBackground; } set { @@ -99,7 +98,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue("White")] + [DefaultValue("White")] public virtual Color SelectionForeground { get { return selForeground; } set { @@ -110,7 +109,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue(Alignment.Left)] + [DefaultValue(Alignment.Left)] public Alignment TextAlignment { get { return _textAlignment; } @@ -122,7 +121,7 @@ namespace Crow NotifyValueChanged ("TextAlignment", _textAlignment); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public virtual bool HorizontalStretch { get { return horizontalStretch; } set { @@ -133,7 +132,7 @@ namespace Crow NotifyValueChanged ("HorizontalStretch", horizontalStretch); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public virtual bool VerticalStretch { get { return verticalStretch; } set { @@ -144,7 +143,7 @@ namespace Crow NotifyValueChanged ("VerticalStretch", verticalStretch); } } - [XmlAttributeAttribute][DefaultValue("label")] + [DefaultValue("label")] public string Text { get { @@ -167,7 +166,7 @@ namespace Crow RegisterForGraphicUpdate (); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public bool Selectable { get { return _selectable; } @@ -182,7 +181,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public bool Multiline { get { return _multiline; } @@ -195,7 +194,7 @@ namespace Crow RegisterForGraphicUpdate(); } } - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public int CurrentColumn{ get { return _currentCol; } set { @@ -210,7 +209,7 @@ namespace Crow NotifyValueChanged ("CurrentColumn", _currentCol); } } - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public int CurrentLine{ get { return _currentLine; } set { @@ -236,7 +235,7 @@ namespace Crow /// <summary> /// Selection begin position in char units /// </summary> - [XmlAttributeAttribute][DefaultValue("-1")] + [DefaultValue("-1")] public Point SelBegin { get { return _selBegin; @@ -249,7 +248,7 @@ namespace Crow NotifyValueChanged ("SelectedText", SelectedText); } } - [XmlAttributeAttribute][DefaultValue("-1")] + [DefaultValue("-1")] public Point SelRelease { get { return _selRelease; diff --git a/src/GraphicObjects/Menu.cs b/src/GraphicObjects/Menu.cs index 0ddb8eae..73396238 100644 --- a/src/GraphicObjects/Menu.cs +++ b/src/GraphicObjects/Menu.cs @@ -41,7 +41,7 @@ namespace Crow bool autoOpen = false; #region Public properties - [XmlAttributeAttribute][DefaultValue(Orientation.Horizontal)] + [DefaultValue(Orientation.Horizontal)] public Orientation Orientation { get { return orientation; } set { diff --git a/src/GraphicObjects/MenuItem.cs b/src/GraphicObjects/MenuItem.cs index 3b25a9fe..a9e164d5 100644 --- a/src/GraphicObjects/MenuItem.cs +++ b/src/GraphicObjects/MenuItem.cs @@ -85,17 +85,17 @@ namespace Crow NotifyValueChanged ("Command", command); } } - [XmlAttributeAttribute] + public override bool IsEnabled { get { return Command == null ? base.IsEnabled : Command.CanExecute; } set { base.IsEnabled = value; } } - [XmlAttributeAttribute] + public override string Caption { get { return Command == null ? base.Caption : Command.Caption; } set { base.Caption = value; } } - [XmlAttributeAttribute] + public Picture Icon { get { return Command == null ? icon : Command.Icon;; } set { @@ -106,7 +106,7 @@ namespace Crow NotifyValueChanged ("Icon", icon); } } - [XmlAttributeAttribute()][DefaultValue("Fit")] + [DefaultValue("Fit")] public virtual Measure PopWidth { get { return popWidth; } set { @@ -116,7 +116,7 @@ namespace Crow NotifyValueChanged ("PopWidth", popWidth); } } - [XmlAttributeAttribute()][DefaultValue("Fit")] + [DefaultValue("Fit")] public virtual Measure PopHeight { get { return popHeight; } set { diff --git a/src/GraphicObjects/NumericControl.cs b/src/GraphicObjects/NumericControl.cs index f0eda90f..73083311 100644 --- a/src/GraphicObjects/NumericControl.cs +++ b/src/GraphicObjects/NumericControl.cs @@ -49,7 +49,7 @@ namespace Crow #endregion #region public properties - [XmlAttributeAttribute][DefaultValue(2)] + [DefaultValue(2)] public int Decimals { get { return _decimals; } @@ -62,7 +62,7 @@ namespace Crow RegisterForGraphicUpdate(); } } - [XmlAttributeAttribute][DefaultValue(0.0)] + [DefaultValue(0.0)] public virtual double Minimum { get { return minValue; } set { @@ -74,7 +74,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue(100.0)] + [DefaultValue(100.0)] public virtual double Maximum { get { return maxValue; } @@ -87,7 +87,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue(1.0)] + [DefaultValue(1.0)] public virtual double SmallIncrement { get { return smallStep; } @@ -100,7 +100,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue(5.0)] + [DefaultValue(5.0)] public virtual double LargeIncrement { get { return bigStep; } diff --git a/src/GraphicObjects/Popper.cs b/src/GraphicObjects/Popper.cs index 1186e8e7..89c0fa5a 100644 --- a/src/GraphicObjects/Popper.cs +++ b/src/GraphicObjects/Popper.cs @@ -46,7 +46,7 @@ namespace Crow public event EventHandler Unpoped; #region Public Properties - [XmlAttributeAttribute()][DefaultValue("Fit")] + [DefaultValue("Fit")] public virtual Measure PopWidth { get { return popWidth; } set { @@ -56,7 +56,7 @@ namespace Crow NotifyValueChanged ("PopWidth", popWidth); } } - [XmlAttributeAttribute()][DefaultValue("Fit")] + [DefaultValue("Fit")] public virtual Measure PopHeight { get { return popHeight; } set { @@ -66,7 +66,7 @@ namespace Crow NotifyValueChanged ("PopHeight", popHeight); } } - [XmlAttributeAttribute()][DefaultValue(false)] + [DefaultValue(false)] public bool IsPopped { get { return _isPopped; } @@ -89,7 +89,7 @@ namespace Crow } } - [XmlAttributeAttribute()][DefaultValue(true)] + [DefaultValue(true)] public bool CanPop { get { return _canPop; } @@ -102,7 +102,7 @@ namespace Crow NotifyValueChanged ("CanPop", _canPop); } } - [XmlAttributeAttribute()][DefaultValue(Alignment.Bottom)] + [DefaultValue(Alignment.Bottom)] public virtual Alignment PopDirection { get { return popDirection; } set { diff --git a/src/GraphicObjects/RadioButton.cs b/src/GraphicObjects/RadioButton.cs index 4c553481..d18971a2 100644 --- a/src/GraphicObjects/RadioButton.cs +++ b/src/GraphicObjects/RadioButton.cs @@ -60,7 +60,7 @@ namespace Crow } #endregion - [XmlAttributeAttribute()][DefaultValue(false)] + [DefaultValue(false)] public bool IsChecked { get { return isChecked; } diff --git a/src/GraphicObjects/SaturationValueSelector.cs b/src/GraphicObjects/SaturationValueSelector.cs index 485a33d2..5a25d6a2 100644 --- a/src/GraphicObjects/SaturationValueSelector.cs +++ b/src/GraphicObjects/SaturationValueSelector.cs @@ -40,7 +40,7 @@ namespace Crow double v, s; - [XmlAttributeAttribute()] + public virtual double V { get { return v; } set { @@ -53,7 +53,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute()] + public virtual double S { get { return s; } set { diff --git a/src/GraphicObjects/ScrollBar.cs b/src/GraphicObjects/ScrollBar.cs index f7f03073..8f777b64 100644 --- a/src/GraphicObjects/ScrollBar.cs +++ b/src/GraphicObjects/ScrollBar.cs @@ -45,7 +45,7 @@ namespace Crow public ScrollBar(Interface iface) : base(iface) {} #endregion - [XmlAttributeAttribute()][DefaultValue(Orientation.Vertical)] + [DefaultValue(Orientation.Vertical)] public virtual Orientation Orientation { get { return _orientation; } @@ -61,7 +61,7 @@ namespace Crow RegisterForGraphicUpdate (); } } - [XmlAttributeAttribute()][DefaultValue(20)] + [DefaultValue(20)] public virtual int CursorSize { get { return _cursorSize; } set { diff --git a/src/GraphicObjects/Scroller.cs b/src/GraphicObjects/Scroller.cs index 4f270725..16f6556d 100644 --- a/src/GraphicObjects/Scroller.cs +++ b/src/GraphicObjects/Scroller.cs @@ -53,7 +53,7 @@ namespace Crow #region public properties /// <summary> Horizontal Scrolling Position </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int ScrollX { get { return scrollX; } set { @@ -76,7 +76,7 @@ namespace Crow } } /// <summary> Vertical Scrolling Position </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int ScrollY { get { return scrollY; } set { @@ -99,7 +99,7 @@ namespace Crow } } /// <summary> Horizontal Scrolling maximum value </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int MaxScrollX { get { return maxScrollX; } set { @@ -116,7 +116,7 @@ namespace Crow } } /// <summary> Vertical Scrolling maximum value </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int MaxScrollY { get { return maxScrollY; } set { @@ -133,7 +133,7 @@ namespace Crow } } /// <summary> Mouse Wheel Scrolling multiplier </summary> - [XmlAttributeAttribute][DefaultValue(50)] + [DefaultValue(50)] public virtual int ScrollSpeed { get { return scrollSpeed; } set { diff --git a/src/GraphicObjects/ScrollingObject.cs b/src/GraphicObjects/ScrollingObject.cs index 855ac0e3..bc57b320 100644 --- a/src/GraphicObjects/ScrollingObject.cs +++ b/src/GraphicObjects/ScrollingObject.cs @@ -52,7 +52,7 @@ namespace Crow protected bool KeyEventsOverrides = false; /// <summary> Horizontal Scrolling Position </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int ScrollX { get { return scrollX; } set { @@ -75,7 +75,7 @@ namespace Crow } } /// <summary> Vertical Scrolling Position </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int ScrollY { get { return scrollY; } set { @@ -98,7 +98,7 @@ namespace Crow } } /// <summary> Horizontal Scrolling maximum value </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int MaxScrollX { get { return maxScrollX; } set { @@ -115,7 +115,7 @@ namespace Crow } } /// <summary> Vertical Scrolling maximum value </summary> - [XmlAttributeAttribute][DefaultValue(0)] + [DefaultValue(0)] public virtual int MaxScrollY { get { return maxScrollY; } set { @@ -132,7 +132,7 @@ namespace Crow } } /// <summary> Mouse Wheel Scrolling multiplier </summary> - [XmlAttributeAttribute][DefaultValue(1)] + [DefaultValue(1)] public virtual int MouseWheelSpeed { get { return mouseWheelSpeed; } set { diff --git a/src/GraphicObjects/Shape.cs b/src/GraphicObjects/Shape.cs index a4b3193e..eb52a06a 100644 --- a/src/GraphicObjects/Shape.cs +++ b/src/GraphicObjects/Shape.cs @@ -75,7 +75,7 @@ namespace Crow RegisterForGraphicUpdate (); } } - [XmlAttributeAttribute][DefaultValue(1.0)] + [DefaultValue(1.0)] public double StokeWidth { get { return strokeWidth; } set { diff --git a/src/GraphicObjects/Splitter.cs b/src/GraphicObjects/Splitter.cs index 3a12b784..8fb7bb77 100644 --- a/src/GraphicObjects/Splitter.cs +++ b/src/GraphicObjects/Splitter.cs @@ -43,7 +43,7 @@ namespace Crow int thickness; - [XmlAttributeAttribute][DefaultValue(1)] + [DefaultValue(1)] public virtual int Thickness { get { return thickness; } set { diff --git a/src/GraphicObjects/TemplatedControl.cs b/src/GraphicObjects/TemplatedControl.cs index 54991a41..a1a11b22 100644 --- a/src/GraphicObjects/TemplatedControl.cs +++ b/src/GraphicObjects/TemplatedControl.cs @@ -69,7 +69,7 @@ namespace Crow /// Template path /// </summary> //TODO: this property should be renamed 'TemplatePath' - [XmlAttributeAttribute][DefaultValue(null)] + [DefaultValue(null)] public string Template { get { return _template; } set { @@ -86,7 +86,7 @@ namespace Crow /// <summary> /// a caption being recurrent need in templated widget, it is declared here. /// </summary> - [XmlAttributeAttribute()][DefaultValue("Templated Control")] + [DefaultValue("Templated Control")] public virtual string Caption { get { return caption; } set { diff --git a/src/GraphicObjects/TemplatedGroup.cs b/src/GraphicObjects/TemplatedGroup.cs index 4d236dab..dd9afb6c 100644 --- a/src/GraphicObjects/TemplatedGroup.cs +++ b/src/GraphicObjects/TemplatedGroup.cs @@ -97,7 +97,7 @@ namespace Crow /// ItemTemplate enclosing tag, or several item templates each enclosed /// in a separate tag. /// </summary> - [XmlAttributeAttribute] + public string ItemTemplate { get { return _itemTemplate; } set { @@ -128,7 +128,7 @@ namespace Crow /// Other possible values are properties of Data /// </summary> /// <value>The data property test.</value> - [XmlAttributeAttribute][DefaultValue("TypeOf")] + [DefaultValue("TypeOf")] public string DataTest { get { return dataTest; } set { @@ -188,7 +188,7 @@ namespace Crow [XmlIgnore]public bool HasItems { get { return Items.Count > 0; } } - [XmlAttributeAttribute]public IList Data { + public IList Data { get { return data; } set { if (value == data) @@ -250,7 +250,7 @@ namespace Crow loadItem (e.Element, items, dataTest); } - [XmlAttributeAttribute][DefaultValue("SteelBlue")] + [DefaultValue("SteelBlue")] public virtual Color SelectionBackground { get { return selBackground; } set { @@ -261,7 +261,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue("White")] + [DefaultValue("White")] public virtual Color SelectionForeground { get { return selForeground; } set { diff --git a/src/GraphicObjects/TextRun.cs b/src/GraphicObjects/TextRun.cs index 17e3b770..297ffe95 100644 --- a/src/GraphicObjects/TextRun.cs +++ b/src/GraphicObjects/TextRun.cs @@ -61,13 +61,13 @@ namespace Crow #endregion - [XmlAttributeAttribute ()] + [DefaultValue (Alignment.Left)] public Alignment TextAlignment { get { return _textAlignment; } set { _textAlignment = value; } } - [XmlAttributeAttribute ()] + [DefaultValue (false)] public virtual bool HorizontalStretch { get { return horizontalStretch; } @@ -79,7 +79,7 @@ namespace Crow NotifyValueChanged ("HorizontalStretch", horizontalStretch); } } - [XmlAttributeAttribute ()] + [DefaultValue (false)] public virtual bool VerticalStretch { get { return verticalStretch; } @@ -91,7 +91,7 @@ namespace Crow NotifyValueChanged ("VerticalStretch", verticalStretch); } } - [XmlAttributeAttribute ()] + [DefaultValue ("label")] public string Text { get { @@ -112,7 +112,7 @@ namespace Crow lines = getLines; } } - [XmlAttributeAttribute ()] + [DefaultValue (false)] public bool Multiline { get { return _multiline; } @@ -121,7 +121,7 @@ namespace Crow RegisterForGraphicUpdate (); } } - [XmlAttributeAttribute ()] + [DefaultValue (false)] public bool WordWrap { get { diff --git a/src/GraphicObjects/TreeView.cs b/src/GraphicObjects/TreeView.cs index 12a99fb3..5a5e7144 100644 --- a/src/GraphicObjects/TreeView.cs +++ b/src/GraphicObjects/TreeView.cs @@ -45,7 +45,7 @@ namespace Crow } #endregion - [XmlAttributeAttribute()][DefaultValue(false)] + [DefaultValue(false)] public virtual bool IsRoot { get { return isRoot; } set { diff --git a/src/GraphicObjects/Trend.cs b/src/GraphicObjects/Trend.cs index 10c5422c..a2e0c838 100644 --- a/src/GraphicObjects/Trend.cs +++ b/src/GraphicObjects/Trend.cs @@ -60,7 +60,7 @@ namespace Crow AddValue (value); } } - [XmlAttributeAttribute()][DefaultValue(400)] + [DefaultValue(400)] public virtual int NbValues { get { return nbValues; } set { @@ -72,7 +72,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute()][DefaultValue(0.0)] + [DefaultValue(0.0)] public virtual double Minimum { get { return minValue; } set { @@ -84,7 +84,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute()][DefaultValue(100.0)] + [DefaultValue(100.0)] public virtual double Maximum { get { return maxValue; } @@ -97,7 +97,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute()][DefaultValue(1.0)] + [DefaultValue(1.0)] public virtual double LowThreshold { get { return lowThreshold; } set { @@ -108,7 +108,7 @@ namespace Crow RegisterForGraphicUpdate (); } } - [XmlAttributeAttribute()][DefaultValue(80.0)] + [DefaultValue(80.0)] public virtual double HighThreshold { get { return highThreshold; } set { @@ -119,7 +119,7 @@ namespace Crow RegisterForGraphicUpdate (); } } - [XmlAttributeAttribute()][DefaultValue("DarkRed")] + [DefaultValue("DarkRed")] public virtual Fill LowThresholdFill { get { return lowThresholdFill; } set { @@ -130,7 +130,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute()][DefaultValue("DarkGreen")] + [DefaultValue("DarkGreen")] public virtual Fill HighThresholdFill { get { return highThresholdFill; } set { diff --git a/src/GraphicObjects/VerticalStack.cs b/src/GraphicObjects/VerticalStack.cs index 9650e685..cf0a251a 100644 --- a/src/GraphicObjects/VerticalStack.cs +++ b/src/GraphicObjects/VerticalStack.cs @@ -43,7 +43,7 @@ namespace Crow } #endregion - [System.Xml.Serialization.XmlIgnore] + [XmlIgnore] public override Orientation Orientation { get { return Orientation.Vertical; } diff --git a/src/GraphicObjects/Window.cs b/src/GraphicObjects/Window.cs index 56632ff3..051ecbde 100644 --- a/src/GraphicObjects/Window.cs +++ b/src/GraphicObjects/Window.cs @@ -84,7 +84,7 @@ namespace Crow #endregion #region public properties - [XmlAttributeAttribute][DefaultValue("#Crow.Images.Icons.crow.png")] + [DefaultValue("#Crow.Images.Icons.crow.png")] public string Icon { get { return _icon; } set { @@ -97,7 +97,7 @@ namespace Crow /// <summary> /// Background of the title bar if any. /// </summary> - [XmlAttributeAttribute][DefaultValue("vgradient|0:Onyx|1:SteelBlue")] + [DefaultValue("vgradient|0:Onyx|1:SteelBlue")] public virtual Fill TitleBarBackground { get { return titleBarBackground; } set { @@ -111,7 +111,7 @@ namespace Crow /// <summary> /// Foreground of the title bar, usualy used for the window caption color. /// </summary> - [XmlAttributeAttribute][DefaultValue("White")] + [DefaultValue("White")] public virtual Fill TitleBarForeground { get { return titleBarForeground; } set { @@ -122,7 +122,7 @@ namespace Crow RegisterForRedraw (); } } - [XmlAttributeAttribute][DefaultValue(true)] + [DefaultValue(true)] public bool Resizable { get { return resizable; @@ -134,7 +134,7 @@ namespace Crow NotifyValueChanged ("Resizable", resizable); } } - [XmlAttributeAttribute][DefaultValue(true)] + [DefaultValue(true)] public bool Movable { get { return movable; @@ -146,7 +146,7 @@ namespace Crow NotifyValueChanged ("Movable", movable); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public bool Modal { get { return modal; @@ -158,7 +158,7 @@ namespace Crow NotifyValueChanged ("Modal", modal); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public bool IsMinimized { get { return _minimized; } set{ @@ -177,7 +177,7 @@ namespace Crow [XmlIgnore]public bool IsNormal { get { return !(IsMaximized|_minimized); } } - [XmlAttributeAttribute][DefaultValue(false)] + [DefaultValue(false)] public bool AlwaysOnTop { get { return modal ? true : alwaysOnTop; @@ -194,7 +194,7 @@ namespace Crow NotifyValueChanged ("AlwaysOnTop", AlwaysOnTop); } } -// [XmlAttributeAttribute()][DefaultValue(WindowState.Normal)] +// [DefaultValue(WindowState.Normal)] // public virtual WindowState State { // get { return _state; } // set { diff --git a/src/GraphicObjects/XmlIgnoreAttribute.cs b/src/GraphicObjects/XmlIgnoreAttribute.cs new file mode 100644 index 00000000..29e5bf6e --- /dev/null +++ b/src/GraphicObjects/XmlIgnoreAttribute.cs @@ -0,0 +1,34 @@ +// +// Expandable.cs +// +// Author: +// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +namespace Crow +{ + public class XmlIgnoreAttribute : Attribute + { + } +}
\ No newline at end of file |