Rename ColorPickerView to ColorSelector 09/119409/2
authorjh5.cho <jh5.cho@samsung.com>
Fri, 17 Mar 2017 01:23:54 +0000 (10:23 +0900)
committerjh5.cho <jh5.cho@samsung.com>
Thu, 23 Mar 2017 04:30:48 +0000 (13:30 +0900)
Change-Id: I68eaae2956d9abeb43b6744922abf8d8c2f66826

Tizen.Xamarin.Forms.Extension.Renderer/ColorSelectorRenderer.cs [moved from Tizen.Xamarin.Forms.Extension.Renderer/ColorPickerViewRenderer.cs with 81% similarity]
Tizen.Xamarin.Forms.Extension.Renderer/Tizen.Xamarin.Forms.Extension.Renderer.csproj
Tizen.Xamarin.Forms.Extension/ColorSelector.cs [moved from Tizen.Xamarin.Forms.Extension/ColorPickerView.cs with 72% similarity]
Tizen.Xamarin.Forms.Extension/Tizen.Xamarin.Forms.Extension.csproj

@@ -1,59 +1,59 @@
 using System.ComponentModel;
 using Tizen.Xamarin.Forms.Extension;
 using Tizen.Xamarin.Forms.Extension.Renderer;
-using Xamarin.Forms;\r
+using Xamarin.Forms;
 using Xamarin.Forms.Platform.Tizen;
 using EColorSelector = ElmSharp.ColorSelector;
 using TForms = Xamarin.Forms.Platform.Tizen.Forms;
-\r
-[assembly: ExportRenderer(typeof(ColorPickerView), typeof(ColorPickerViewRenderer))]
+
+[assembly: ExportRenderer(typeof(ColorSelector), typeof(ColorSelectorRenderer))]
 namespace Tizen.Xamarin.Forms.Extension.Renderer
 {
-    public class ColorPickerViewRenderer : ViewRenderer<ColorPickerView, EColorSelector>
-    {\r
-        public ColorPickerViewRenderer()
+    public class ColorSelectorRenderer : ViewRenderer<ColorSelector, EColorSelector>
+    {
+        public ColorSelectorRenderer()
         {
         }
 
-        protected override void OnElementChanged(ElementChangedEventArgs<ColorPickerView> e)
+        protected override void OnElementChanged(ElementChangedEventArgs<ColorSelector> e)
         {
-            if (Control == null)\r
-            {\r
-                var _colorSelector = new EColorSelector(TForms.Context.MainWindow);\r
+            if (Control == null)
+            {
+                var _colorSelector = new EColorSelector(TForms.Context.MainWindow);
                 SetNativeControl(_colorSelector);
             }
 
-            if (e.OldElement != null)\r
-            {\r
-                Control.ColorChanged -= ColorChangedHandler;\r
+            if (e.OldElement != null)
+            {
+                Control.ColorChanged -= ColorChangedHandler;
             }
 
-            if (e.NewElement != null)\r
-            {\r
-                UpdateSelectedColor();\r
-                Control.ColorChanged += ColorChangedHandler;\r
+            if (e.NewElement != null)
+            {
+                UpdateSelectedColor();
+                Control.ColorChanged += ColorChangedHandler;
             }
             base.OnElementChanged(e);
-        }\r
-\r
+        }
+
         protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
-        {\r
-            if (e.PropertyName == ColorPickerView.SelectedColorProperty.PropertyName)
-            {\r
+        {
+            if (e.PropertyName == ColorSelector.SelectedColorProperty.PropertyName)
+            {
                 UpdateSelectedColor();
             }
             base.OnElementPropertyChanged(sender, e);
-        }\r
-\r
+        }
+
         void UpdateSelectedColor()
         {
             Control.SelectedColor = Element.SelectedColor.ToNative();
-        }\r
-\r
-        void ColorChangedHandler(object sender, ElmSharp.ColorChangedEventArgs e)\r
-        {\r
-            var color = Control.SelectedColor;\r
-            Element.SelectedColor = Color.FromRgba(color.R, color.G, color.B, color.A);\r
-        }\r
+        }
+
+        void ColorChangedHandler(object sender, ElmSharp.ColorChangedEventArgs e)
+        {
+            var color = Control.SelectedColor;
+            Element.SelectedColor = Color.FromRgba(color.R, color.G, color.B, color.A);
+        }
     }
 }
index 6fb1056..69e7394 100755 (executable)
@@ -36,7 +36,7 @@
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   <ItemGroup>\r
-    <Compile Include="ColorPickerViewRenderer.cs" />\r
+    <Compile Include="ColorSelectorRenderer.cs" />\r
     <Compile Include="MediaViewRenderer.cs" />\r
     <Compile Include="DropdownListRenderer.cs" />\r
     <Compile Include="BackgroundRenderer.cs" />\r
similarity index 72%
rename from Tizen.Xamarin.Forms.Extension/ColorPickerView.cs
rename to Tizen.Xamarin.Forms.Extension/ColorSelector.cs
index 1606d52..58e3fa6 100755 (executable)
@@ -1,46 +1,46 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Collections.ObjectModel;\r
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using Xamarin.Forms;
 
 namespace Tizen.Xamarin.Forms.Extension
-{\r
-    /// <summary>\r
-    /// The ColorPickerView class allows the user to select a color.\r
+{
+    /// <summary>
+    /// The ColorSelector class allows the user to select a color.
     /// </summary>
     /// <example>
     /// <code>
-    /// ColorPickerView colorPickerView = new ColorPickerView();\r
-    /// colorPickerView.ColorChanged += (s, e) =>\r
-    /// {\r
-    ///         Debug.WriteLine("Old Color: " + e.OldColor);\r
-    ///         Debug.WriteLine("New Color: " + e.NewColor);\r
-    /// };\r
+    /// ColorSelector colorSelector = new ColorSelector();
+    /// colorSelector.ColorChanged += (s, e) =>
+    /// {
+    ///         Debug.WriteLine("Old Color: " + e.OldColor);
+    ///         Debug.WriteLine("New Color: " + e.NewColor);
+    /// };
     /// </code>
     /// </example>
-    public class ColorPickerView : View
+    public class ColorSelector : View
     {
-        public static readonly BindableProperty SelectedColorProperty = BindableProperty.Create("SelectedColor", typeof(Color), typeof(ColorPickerView), Color.Default, propertyChanged: OnSelectedColorChanged );\r
-\r
-        /// <summary>\r
-        /// Get or set current selected color from ColorPickerView\r
-        /// Default value is Color.Default\r
-        /// </summary>\r
+        public static readonly BindableProperty SelectedColorProperty = BindableProperty.Create("SelectedColor", typeof(Color), typeof(ColorSelector), Color.Default, propertyChanged: OnSelectedColorChanged );
+
+        /// <summary>
+        /// Get or set current selected color from ColorSelector
+        /// Default value is Color.Default
+        /// </summary>
         public Color SelectedColor
         {
             get { return (Color)GetValue(SelectedColorProperty); }
             set { SetValue(SelectedColorProperty, value); }
         }
 
-        /// <summary>\r
-        /// Occurs when the SelectedColor value changes\r
+        /// <summary>
+        /// Occurs when the SelectedColor value changes
         /// </summary>
-        public event EventHandler<ColorChangedEventArgs> ColorChanged;\r
-\r
-        static void OnSelectedColorChanged(BindableObject bindable, object oldValue, object newValue)\r
-        {\r
-            var colorSelector = bindable as ColorPickerView;\r
-            colorSelector.ColorChanged?.Invoke(colorSelector, new ColorChangedEventArgs(((Color)oldValue), (Color)newValue));\r
-        }\r
+        public event EventHandler<ColorChangedEventArgs> ColorChanged;
+
+        static void OnSelectedColorChanged(BindableObject bindable, object oldValue, object newValue)
+        {
+            var colorSelector = bindable as ColorSelector;
+            colorSelector.ColorChanged?.Invoke(colorSelector, new ColorChangedEventArgs(((Color)oldValue), (Color)newValue));
+        }
     }
 }
index 21e35e2..2e345ce 100644 (file)
@@ -54,7 +54,7 @@
   </PropertyGroup>\r
   <ItemGroup>\r
     <Compile Include="ColorChangedEventArgs.cs" />\r
-    <Compile Include="ColorPickerView.cs" />\r
+    <Compile Include="ColorSelector.cs" />\r
     <Compile Include="IMediaViewController.cs" />\r
     <Compile Include="MediaView.cs" />\r
     <Compile Include="Background.cs" />\r
   <Target Name="AfterBuild">\r
   </Target>\r
   -->\r
-</Project>
+</Project>\r