From 52972aa2310abba9f684926a9a731cfdab0b8484 Mon Sep 17 00:00:00 2001 From: "pius.lee" Date: Wed, 25 Oct 2017 14:33:50 +0900 Subject: [PATCH] [ElmSharp.Wearable] Get back old ctor and Disabled for ABI Change-Id: I3d0cf34f079c49f42cf7d3a0f3d8d0813c7749b1 --- .../ElmSharp.Wearable/CircleDatetimeSelector.cs | 23 ++++++++++++++++++++++ .../ElmSharp.Wearable/CircleGenList.cs | 23 ++++++++++++++++++++++ .../ElmSharp.Wearable/CircleProgressBar.cs | 22 +++++++++++++++++++++ .../ElmSharp.Wearable/CircleScroller.cs | 23 ++++++++++++++++++++++ .../ElmSharp.Wearable/CircleSlider.cs | 23 ++++++++++++++++++++++ .../ElmSharp.Wearable/CircleSpinner.cs | 23 ++++++++++++++++++++++ .../ElmSharp.Wearable/CircleSurface.cs | 11 +++++++++++ 7 files changed, 148 insertions(+) diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleDatetimeSelector.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleDatetimeSelector.cs index 851b135..28a8f89 100644 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleDatetimeSelector.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleDatetimeSelector.cs @@ -15,6 +15,7 @@ */ using System; +using System.ComponentModel; using System.Diagnostics; namespace ElmSharp.Wearable @@ -41,6 +42,17 @@ namespace ElmSharp.Wearable } /// + /// Creates and initializes a new instance of the Circle DateTimeSelector class. + /// + /// The parent of new Circle CircleDateTimeSelector instance + [Obsolete("It is not safe for guess circle surface from parent and create new surface by every new widget")] + [EditorBrowsable(EditorBrowsableState.Never)] + public CircleDateTimeSelector(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent)) + { + ((IRotaryActionWidget)this).Activate(); + } + + /// /// Gets the handle for Circle Widget. /// public virtual IntPtr CircleHandle => _circleHandle; @@ -51,6 +63,17 @@ namespace ElmSharp.Wearable public virtual CircleSurface CircleSurface => _surface; /// + /// Sets or gets disabled state of this widget. + /// + [Obsolete("Use IsEnabled")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Disabled + { + get => !IsEnabled; + set => IsEnabled = !value; + } + + /// /// Sets or gets the state of the widget, which might be enabled or disabled. /// public override bool IsEnabled diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleGenList.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleGenList.cs index 1de98bd..7dc18e1 100644 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleGenList.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleGenList.cs @@ -15,6 +15,7 @@ */ using System; +using System.ComponentModel; using System.Diagnostics; namespace ElmSharp.Wearable @@ -41,6 +42,17 @@ namespace ElmSharp.Wearable } /// + /// Creates and initializes a new instance of the Circle GenList class. + /// + /// The parent of new Circle CircleGenList instance + [Obsolete("It is not safe for guess circle surface from parent and create new surface by every new widget")] + [EditorBrowsable(EditorBrowsableState.Never)] + public CircleGenList(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent)) + { + ((IRotaryActionWidget)this).Activate(); + } + + /// /// Gets the handle for Circle Widget. /// public virtual IntPtr CircleHandle => _circleHandle; @@ -51,6 +63,17 @@ namespace ElmSharp.Wearable public virtual CircleSurface CircleSurface => _surface; /// + /// Sets or gets disabled state of this widget. + /// + [Obsolete("Use IsEnabled")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Disabled + { + get => !IsEnabled; + set => IsEnabled = !value; + } + + /// /// Sets or gets the state of the widget, which might be enabled or disabled. /// public override bool IsEnabled diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleProgressBar.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleProgressBar.cs index f4d7cbf..843b8aa 100644 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleProgressBar.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleProgressBar.cs @@ -15,6 +15,7 @@ */ using System; +using System.ComponentModel; using System.Diagnostics; namespace ElmSharp.Wearable @@ -40,6 +41,16 @@ namespace ElmSharp.Wearable } /// + /// Creates and initializes a new instance of the Circle Progressbar class. + /// + /// The parent of new Circle Progressbar instance + [Obsolete("It is not safe for guess circle surface from parent and create new surface by every new widget")] + [EditorBrowsable(EditorBrowsableState.Never)] + public CircleProgressBar(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent)) + { + } + + /// /// Gets the handle for Circle Widget. /// public virtual IntPtr CircleHandle => Handle; @@ -50,6 +61,17 @@ namespace ElmSharp.Wearable public virtual CircleSurface CircleSurface => _surface; /// + /// Sets or gets disabled state of this widget. + /// + [Obsolete("Use IsEnabled")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Disabled + { + get => !IsEnabled; + set => IsEnabled = !value; + } + + /// /// Sets or gets the state of the widget, which might be enabled or disabled. /// public override bool IsEnabled diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleScroller.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleScroller.cs index e60f31e..7eaf307 100644 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleScroller.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleScroller.cs @@ -15,6 +15,7 @@ */ using System; +using System.ComponentModel; using System.Diagnostics; namespace ElmSharp.Wearable @@ -40,6 +41,17 @@ namespace ElmSharp.Wearable } /// + /// Creates and initializes a new instance of the Circle Scroller class. + /// + /// The parent of new Circle CircleScroller instance + [Obsolete("It is not safe for guess circle surface from parent and create new surface by every new widget")] + [EditorBrowsable(EditorBrowsableState.Never)] + public CircleScroller(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent)) + { + ((IRotaryActionWidget)this).Activate(); + } + + /// /// Gets the handle for Circle Widget. /// public virtual IntPtr CircleHandle => _circleHandle; @@ -50,6 +62,17 @@ namespace ElmSharp.Wearable public virtual CircleSurface CircleSurface => _surface; /// + /// Sets or gets disabled state of this widget. + /// + [Obsolete("Use IsEnabled")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Disabled + { + get => !IsEnabled; + set => IsEnabled = !value; + } + + /// /// Sets or gets the state of the widget, which might be enabled or disabled. /// public override bool IsEnabled diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSlider.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSlider.cs index 06bd53b..61959e0 100755 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSlider.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSlider.cs @@ -15,6 +15,7 @@ */ using System; +using System.ComponentModel; using System.Diagnostics; namespace ElmSharp.Wearable @@ -40,6 +41,17 @@ namespace ElmSharp.Wearable } /// + /// Creates and initializes a new instance of the Circle Slider class. + /// + /// The parent of new Circle CircleSlider instance + [Obsolete("It is not safe for guess circle surface from parent and create new surface by every new widget")] + [EditorBrowsable(EditorBrowsableState.Never)] + public CircleSlider(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent)) + { + ((IRotaryActionWidget)this).Activate(); + } + + /// /// Changed will be triggered when the circle slider value changes. /// public event EventHandler ValueChanged; @@ -74,6 +86,17 @@ namespace ElmSharp.Wearable } /// + /// Sets or gets disabled state of this widget. + /// + [Obsolete("Use IsEnabled")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Disabled + { + get => !IsEnabled; + set => IsEnabled = !value; + } + + /// /// Sets or gets the state of the widget, which might be enabled or disabled. /// public override bool IsEnabled diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs index e66fa54..8a39ce5 100644 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs @@ -15,6 +15,7 @@ */ using System; +using System.ComponentModel; using System.Diagnostics; namespace ElmSharp.Wearable @@ -43,6 +44,17 @@ namespace ElmSharp.Wearable } /// + /// Creates and initializes a new instance of the Circle Spinner class. + /// + /// The parent of new Circle CircleSpinner instance + [Obsolete("It is not safe for guess circle surface from parent and create new surface by every new widget")] + [EditorBrowsable(EditorBrowsableState.Never)] + public CircleSpinner(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent)) + { + ((IRotaryActionWidget)this).Activate(); + } + + /// /// Gets the handle for Circle Widget. /// public virtual IntPtr CircleHandle => RealHandle; @@ -69,6 +81,17 @@ namespace ElmSharp.Wearable } /// + /// Sets or gets disabled state of this widget. + /// + [Obsolete("Use IsEnabled")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Disabled + { + get => !IsEnabled; + set => IsEnabled = !value; + } + + /// /// Sets or gets the state of the widget, which might be enabled or disabled. /// public override bool IsEnabled diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSurface.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSurface.cs index 91da5a1..e00b593 100644 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSurface.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSurface.cs @@ -46,6 +46,17 @@ namespace ElmSharp.Wearable _handle = IntPtr.Zero; } + /// + /// Gets the handle for CircleSurface + /// public IntPtr Handle => _handle; + + internal static CircleSurface CreateCircleSurface(EvasObject obj) + { + if (obj is Conformant) return new CircleSurface(obj as Conformant); + else if (obj is Naviframe) return new CircleSurface(obj as Naviframe); + else if (obj is Layout) return new CircleSurface(obj as Layout); + else return new CircleSurface(); + } } } -- 2.7.4