From 4a7050f54b5da5bbf813ea1fd5329f567930d65c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Wed, 18 Jan 2017 15:25:43 +0100 Subject: [PATCH] Tag as full crow property + comments --- src/GraphicObjects/GraphicObject.cs | 30 ++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index e0f1ebfd..70334e12 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -82,6 +82,7 @@ namespace Crow bool clipToClientRect = true; protected object dataSource; string style; + object tag; #endregion #region public fields @@ -103,8 +104,6 @@ namespace Crow public Rectangle LastPaintedSlot; /// Prevent requeuing multiple times the same widget public bool IsQueueForRedraw = false; - /// Random value placeholder - public object Tag; /// drawing Cache, if null, a redraw is done, cached or not public byte[] bmp; public bool IsDirty = true; @@ -195,7 +194,22 @@ namespace Crow #endregion #region public properties - [XmlAttributeAttribute()][DefaultValue(true)] + /// Random value placeholder + [XmlAttributeAttribute] + public object Tag { + get { return tag; } + set { + if (tag == value) + return; + tag = value; + NotifyValueChanged ("Tag", tag); + } + } + /// + /// If enabled, resulting bitmap of graphic object is cached in an byte array + /// speeding up rendering of complex object. Default is enabled. + /// + [XmlAttributeAttribute][DefaultValue(true)] public virtual bool CacheEnabled { get { return cacheEnabled; } set { @@ -205,7 +219,10 @@ namespace Crow NotifyValueChanged ("CacheEnabled", cacheEnabled); } } - [XmlAttributeAttribute()][DefaultValue(true)] + /// + /// If true, rendering of GraphicObject is clipped inside client rectangle + /// + [XmlAttributeAttribute][DefaultValue(true)] public virtual bool ClipToClientRect { get { return clipToClientRect; } set { @@ -216,7 +233,10 @@ namespace Crow this.RegisterForRedraw (); } } - [XmlAttributeAttribute()][DefaultValue(null)] + /// + /// Name is used in binding to reference other GraphicObjects inside the graphic tree + /// + [XmlAttributeAttribute][DefaultValue(null)] public virtual string Name { get { #if DEBUG -- 2.47.3