From: YeongJong Lee Date: Tue, 1 Sep 2020 10:26:15 +0000 (+0900) Subject: [NUI] replace NUI.ISelectorItem with System.ICloneable (#1965) X-Git-Tag: accepted/tizen/unified/20210219.040944~450 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b0e274d1d3fca5387ca2554d2101f5a2247de227;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] replace NUI.ISelectorItem with System.ICloneable (#1965) `Tizen.NUI.ISelectorItem` and `System.ICloneable` are exactly same interface. --- diff --git a/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs b/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs index 1a8dd10..82aabb3 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs @@ -835,7 +835,7 @@ namespace Tizen.NUI.BaseComponents /// A class containing frame informations for a LottieAnimationView. /// [EditorBrowsable(EditorBrowsableState.Never)] - public class LottieFrameInfo : ISelectorItem + public class LottieFrameInfo : ICloneable { /// /// Creates a new instance with a playing range. diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/ISelectorItem.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/ISelectorItem.cs deleted file mode 100644 index 1ec5e37..0000000 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/ISelectorItem.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright(c) 2020 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -using System.ComponentModel; - -namespace Tizen.NUI -{ - /// - /// An interface for the Selector and the Selector item. - /// Selector item class should implement this. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public interface ISelectorItem - { - /// - /// Deep copy. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - object Clone(); - } -} diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/Selector.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/Selector.cs index 6c05400..6c9e8a7 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/Selector.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/Selector.cs @@ -24,13 +24,13 @@ namespace Tizen.NUI.BaseComponents /// /// Selector class, which is related by Control State, it is base class for other Selector. /// + /// The property type of the selector. if it's reference type, it should be of type that implement deep copy in . /// 6 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class Selector : StateValueCollection { - private readonly bool isSelectorItem = typeof(ISelectorItem).IsAssignableFrom(typeof(T)); - + private readonly bool isCloneable = typeof(ICloneable).IsAssignableFrom(typeof(T)); /// 6 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. public static implicit operator Selector(T value) @@ -48,7 +48,7 @@ namespace Tizen.NUI.BaseComponents [EditorBrowsable(EditorBrowsableState.Never)] public Selector(T value) : this() { - All = isSelectorItem ? (T)((ISelectorItem)value)?.Clone() : value; + All = isCloneable ? (T)((ICloneable)value)?.Clone() : value; } /// Copy constructor @@ -338,12 +338,12 @@ namespace Tizen.NUI.BaseComponents { Clear(); - if (isSelectorItem) + if (isCloneable) { - All = (T)((ISelectorItem)other.All)?.Clone(); + All = (T)((ICloneable)other.All)?.Clone(); foreach (var item in other.StateValueList) { - AddWithoutCheck(new StateValuePair(item.State, (T)((ISelectorItem)item.Value)?.Clone())); + AddWithoutCheck(new StateValuePair(item.State, (T)((ICloneable)item.Value)?.Clone())); } } else diff --git a/src/Tizen.NUI/src/public/Color.cs b/src/Tizen.NUI/src/public/Color.cs index e5c8ec6..3778d54 100755 --- a/src/Tizen.NUI/src/public/Color.cs +++ b/src/Tizen.NUI/src/public/Color.cs @@ -26,7 +26,7 @@ namespace Tizen.NUI /// The Color class. /// [Tizen.NUI.Binding.TypeConverter(typeof(ColorTypeConverter))] - public class Color : Disposable, ISelectorItem + public class Color : Disposable, ICloneable { /// /// Gets the black colored Color class. diff --git a/src/Tizen.NUI/src/public/Extents.cs b/src/Tizen.NUI/src/public/Extents.cs index b77d984..2652b30 100755 --- a/src/Tizen.NUI/src/public/Extents.cs +++ b/src/Tizen.NUI/src/public/Extents.cs @@ -14,6 +14,7 @@ * limitations under the License. * */ +using System; using System.ComponentModel; using Tizen.NUI.Binding; @@ -24,7 +25,7 @@ namespace Tizen.NUI /// /// 4 [Binding.TypeConverter(typeof(ExtentsTypeConverter))] - public class Extents : Disposable, ISelectorItem + public class Extents : Disposable, ICloneable { diff --git a/src/Tizen.NUI/src/public/Position.cs b/src/Tizen.NUI/src/public/Position.cs index fb92ad6..f0060d6 100755 --- a/src/Tizen.NUI/src/public/Position.cs +++ b/src/Tizen.NUI/src/public/Position.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI /// /// 3 [Tizen.NUI.Binding.TypeConverter(typeof(PositionTypeConverter))] - public class Position : Disposable, ISelectorItem + public class Position : Disposable, ICloneable { /// diff --git a/src/Tizen.NUI/src/public/Position2D.cs b/src/Tizen.NUI/src/public/Position2D.cs index da844d6..11204a8 100755 --- a/src/Tizen.NUI/src/public/Position2D.cs +++ b/src/Tizen.NUI/src/public/Position2D.cs @@ -26,7 +26,7 @@ namespace Tizen.NUI /// /// 3 [Tizen.NUI.Binding.TypeConverter(typeof(Position2DTypeConverter))] - public class Position2D : Disposable, ISelectorItem + public class Position2D : Disposable, ICloneable { private Position2DChangedCallback callback = null; diff --git a/src/Tizen.NUI/src/public/Rectangle.cs b/src/Tizen.NUI/src/public/Rectangle.cs index 1d849ec..63241af 100755 --- a/src/Tizen.NUI/src/public/Rectangle.cs +++ b/src/Tizen.NUI/src/public/Rectangle.cs @@ -14,6 +14,7 @@ * limitations under the License. * */ +using System; using System.ComponentModel; using Tizen.NUI.Binding; @@ -24,7 +25,7 @@ namespace Tizen.NUI /// /// 3 [Binding.TypeConverter(typeof(RectangleTypeConverter))] - public class Rectangle : Disposable, ISelectorItem + public class Rectangle : Disposable, ICloneable { /// /// The constructor. diff --git a/src/Tizen.NUI/src/public/Size.cs b/src/Tizen.NUI/src/public/Size.cs index 44a2a0d..72a1014 100755 --- a/src/Tizen.NUI/src/public/Size.cs +++ b/src/Tizen.NUI/src/public/Size.cs @@ -26,7 +26,7 @@ namespace Tizen.NUI /// /// 5 [Tizen.NUI.Binding.TypeConverter(typeof(SizeTypeConverter))] - public class Size : Disposable, ISelectorItem + public class Size : Disposable, ICloneable { /// diff --git a/src/Tizen.NUI/src/public/Size2D.cs b/src/Tizen.NUI/src/public/Size2D.cs index ee365bf..4da1854 100755 --- a/src/Tizen.NUI/src/public/Size2D.cs +++ b/src/Tizen.NUI/src/public/Size2D.cs @@ -14,9 +14,9 @@ * limitations under the License. * */ +using System; using System.ComponentModel; using Tizen.NUI.Binding; -using System.ComponentModel; namespace Tizen.NUI { @@ -25,7 +25,7 @@ namespace Tizen.NUI /// /// 3 [Tizen.NUI.Binding.TypeConverter(typeof(Size2DTypeConverter))] - public class Size2D : Disposable, ISelectorItem + public class Size2D : Disposable, ICloneable { private Size2DChangedCallback callback = null; diff --git a/src/Tizen.NUI/src/public/Vector2.cs b/src/Tizen.NUI/src/public/Vector2.cs index d26cfac..f25465a 100755 --- a/src/Tizen.NUI/src/public/Vector2.cs +++ b/src/Tizen.NUI/src/public/Vector2.cs @@ -14,6 +14,7 @@ * limitations under the License. * */ +using System; using System.ComponentModel; using Tizen.NUI.Binding; @@ -25,7 +26,7 @@ namespace Tizen.NUI /// /// 3 [Binding.TypeConverter(typeof(Vector2TypeConverter))] - public class Vector2 : Disposable, ISelectorItem + public class Vector2 : Disposable, ICloneable { /// diff --git a/src/Tizen.NUI/src/public/Vector3.cs b/src/Tizen.NUI/src/public/Vector3.cs index 0f4285e..92f4817 100755 --- a/src/Tizen.NUI/src/public/Vector3.cs +++ b/src/Tizen.NUI/src/public/Vector3.cs @@ -14,6 +14,7 @@ * limitations under the License. * */ +using System; using System.ComponentModel; using Tizen.NUI.Binding; @@ -25,7 +26,7 @@ namespace Tizen.NUI /// /// 3 [Binding.TypeConverter(typeof(Vector3TypeConverter))] - public class Vector3 : Disposable, ISelectorItem + public class Vector3 : Disposable, ICloneable { /// /// The constructor. diff --git a/src/Tizen.NUI/src/public/Vector4.cs b/src/Tizen.NUI/src/public/Vector4.cs index 31d8e8d..bf060c1 100755 --- a/src/Tizen.NUI/src/public/Vector4.cs +++ b/src/Tizen.NUI/src/public/Vector4.cs @@ -14,6 +14,7 @@ * limitations under the License. * */ +using System; using System.ComponentModel; using Tizen.NUI.Binding; @@ -25,7 +26,7 @@ namespace Tizen.NUI /// /// 3 [Binding.TypeConverter(typeof(Vector4TypeConverter))] - public class Vector4 : Disposable, ISelectorItem + public class Vector4 : Disposable, ICloneable { /// diff --git a/src/Tizen.NUI/src/public/ViewProperty/ImageShadow.cs b/src/Tizen.NUI/src/public/ViewProperty/ImageShadow.cs index 4e45424..891351b 100644 --- a/src/Tizen.NUI/src/public/ViewProperty/ImageShadow.cs +++ b/src/Tizen.NUI/src/public/ViewProperty/ImageShadow.cs @@ -25,7 +25,7 @@ namespace Tizen.NUI /// The Shadow composed of image for View /// [EditorBrowsable(EditorBrowsableState.Never)] - public class ImageShadow : ShadowBase, ISelectorItem + public class ImageShadow : ShadowBase, ICloneable { private static readonly Rectangle noBorder = new Rectangle(); diff --git a/src/Tizen.NUI/src/public/ViewProperty/Shadow.cs b/src/Tizen.NUI/src/public/ViewProperty/Shadow.cs index ac92045..680b010 100644 --- a/src/Tizen.NUI/src/public/ViewProperty/Shadow.cs +++ b/src/Tizen.NUI/src/public/ViewProperty/Shadow.cs @@ -25,7 +25,7 @@ namespace Tizen.NUI /// Represents a shadow with color and blur radius for a View. /// [EditorBrowsable(EditorBrowsableState.Never)] - public class Shadow : ShadowBase, ISelectorItem + public class Shadow : ShadowBase, ICloneable { private static readonly Color noColor = new Color(0, 0, 0, 0); diff --git a/src/Tizen.NUI/src/public/ViewProperty/TextShadow.cs b/src/Tizen.NUI/src/public/ViewProperty/TextShadow.cs index bddc297..af116f8 100755 --- a/src/Tizen.NUI/src/public/ViewProperty/TextShadow.cs +++ b/src/Tizen.NUI/src/public/ViewProperty/TextShadow.cs @@ -24,7 +24,7 @@ namespace Tizen.NUI /// The Text Shadow for TextLabel. /// [EditorBrowsable(EditorBrowsableState.Never)] - public class TextShadow : ISelectorItem + public class TextShadow : ICloneable { private readonly PropertyMap propertyMap = null;