Add comments for TVApps.Controls
authorHeonjae Jang <heonjae.jang@samsung.com>
Wed, 29 Mar 2017 07:51:29 +0000 (16:51 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:51 +0000 (18:34 +0900)
Change-Id: Ifd3a6313b4eea1ac035ac2777c0b79afcb78237c

TVApps/TVApps/Controls/AppItemCell.xaml.cs
TVApps/TVApps/Controls/AppListView.xaml.cs
TVApps/TVApps/Controls/CustomButton.xaml.cs
TVApps/TVApps/Controls/NinePatchImage.xaml.cs
TVApps/TVApps/Controls/TVButton.xaml.cs

index bc9cb6256818fbbf66867750660ba4e952b23b23..661396defe34ed248a098f0b49fa21d7ed2069b3 100755 (executable)
@@ -21,6 +21,9 @@ using Xamarin.Forms;
 
 namespace TVApps.Controls
 {
+    /// <summary>
+    /// A enumeration for AppItemCell icon size
+    /// </summary>
     public enum IconSize
     {
         Normal = 0,
@@ -28,24 +31,28 @@ namespace TVApps.Controls
     };
 
     /// <summary>
-    /// Custom Control for Apps List Item Template
+    /// A custom control for AppListView item template
     /// </summary>
     public partial class AppItemCell : ViewCell
     {
         /// <summary>
-        /// The command will be excuted if the button is clicked
+        /// A command will be executed if the button is clicked
         /// </summary>
         public ICommand OnClickedCommand { get; set; }
 
         /// <summary>
-        /// The command will be excuted if the button is focused
+        /// A command will be executed if the button is focused
         /// </summary>
         public ICommand OnFocusedCommand { get; set; }
 
         /// <summary>
-        /// The property for pinned state
+        /// Identifies the IsPinned bindable property
         /// </summary>
         public static readonly BindableProperty IsPinnedProperty = BindableProperty.Create("IsPinned", typeof(bool), typeof(AppItemCell), default(bool));
+
+        /// <summary>
+        /// Gets or sets pin state of AppItemCell
+        /// </summary>
         public bool IsPinned
         {
             get { return (bool)GetValue(IsPinnedProperty); }
@@ -53,9 +60,13 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// The property for checked state
+        /// Identifies the IsChecked bindable property
         /// </summary>
         public static readonly BindableProperty IsCheckedProperty = BindableProperty.Create("IsChecked", typeof(bool), typeof(AppItemCell), default(bool));
+
+        /// <summary>
+        /// Gets or sets check state of AppItemCell
+        /// </summary>
         public bool IsChecked
         {
             get { return (bool)GetValue(IsCheckedProperty); }
@@ -63,9 +74,13 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// The property for show state of option menu
+        /// Identifies the IsShowOptions bindable property
         /// </summary>
         public static readonly BindableProperty IsShowOptionsProperty = BindableProperty.Create("IsShowOptions", typeof(bool), typeof(AppItemCell), default(bool));
+
+        /// <summary>
+        /// Gets or sets visible state of Option Menu
+        /// </summary>
         public bool IsShowOptions
         {
             get { return (bool)GetValue(IsShowOptionsProperty); }
@@ -73,9 +88,13 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// The property for dim state
+        /// Identifies the IsDim bindable property
         /// </summary>
         public static readonly BindableProperty IsDimProperty = BindableProperty.Create("IsDim", typeof(bool), typeof(AppItemCell), default(bool));
+
+        /// <summary>
+        /// Gets or sets dim state of AppItemCell
+        /// </summary>
         public bool IsDim
         {
             get { return (bool)GetValue(IsDimProperty); }
@@ -83,9 +102,13 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// The property for focused state
+        /// Identifies the IsFocused bindable property
         /// </summary>
         public static readonly BindableProperty IsFocusedProperty = BindableProperty.Create("IsFocused", typeof(bool), typeof(AppItemCell), default(bool), BindingMode.TwoWay);
+
+        /// <summary>
+        /// Gets or sets focus state of AppItemCell
+        /// </summary>
         public bool IsFocused
         {
             get { return (bool)GetValue(IsFocusedProperty); }
@@ -93,7 +116,8 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Constructor
+        /// A constructor
+        /// Adds PropertyChanged event handler
         /// </summary>
         public AppItemCell()
         {
@@ -104,7 +128,7 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Handles AppItemCell Property Changed event
+        /// This method is called when the properties of AppItemCell is changed
         /// Runs animation according to property change of AppItemCell
         /// </summary>
         /// <param name="sender">The source of the event</param>
@@ -164,9 +188,9 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Changes positon and scale of ButtomImage and TextArea
+        /// A method changes position and scale of ButtomImage and TextArea
         /// </summary>
-        /// <param name="size">Icon Size for changing</param>
+        /// <param name="size">IconSize for change scale and position</param>
         public void ChangeIconSize(IconSize size)
         {
             ButtonImage.ScaleTo((size == IconSize.Normal) ? 1.0 : 1.32, 50);
@@ -175,7 +199,7 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Shows option menu
+        /// A method shows or hides option menu according to parameter
         /// </summary>
         /// <param name="isShow">A flag indicates whether the option menu should be showed or not</param>
         public void ShowOptionMenu(bool isShow)
@@ -187,7 +211,7 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Handles button title Property Changed event
+        /// This method is called when the properties of TextArea is changed
         /// </summary>
         /// <param name="sender">The source of the event</param>
         /// <param name="e">The event that is occurred when property of ButtonTitle is changed</param>
@@ -200,7 +224,7 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Handles Button Clicked event
+        /// This method is called when the AppItemCell is clicked
         /// </summary>
         /// <param name="sender">The source of the event</param>
         /// <param name="e">The event that is occurred when button is clicked</param>
@@ -210,7 +234,7 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Handles Button Focused event
+        /// This method is called when the AppItemCell receives focus
         /// </summary>
         /// <param name="sender">The source of the event</param>
         /// <param name="e">The event that is occurred when button is focused</param>
@@ -235,10 +259,10 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Handles Button Unfocused event
+        /// This method is called when the AppItemCell loses focus
         /// </summary>
         /// <param name="sender">The source of the event</param>
-        /// <param name="e">The event that is occured when button is unfocused</param>
+        /// <param name="e">The event that is occurred when button is unfocused</param>
         private void OnUnFocused(object sender, EventArgs e)
         {
             IsFocused = false;
index b5879cac0822638b5d3a4b2ab672502572e07dc5..0d2a340f3d92fa113a3413b034463aee6fc14a56 100644 (file)
@@ -24,14 +24,19 @@ using System.Threading.Tasks;
 namespace TVApps.Controls
 {
     /// <summary>
-    /// TV Apps Custom ListView
+    /// A custom control for list in TV Apps
     /// </summary>
     public partial class AppListView : ScrollView
     {
+
         /// <summary>
-        /// The property for source of list items
+        /// Identifies the ItemsSource bindable property
         /// </summary>
         public static readonly BindableProperty ItemsSourceProperty = BindableProperty.Create("ItemsSource", typeof(IEnumerable<ShortcutInfo>), typeof(AppListView), default(IEnumerable<ShortcutInfo>));
+
+        /// <summary>
+        /// Gets or sets source of list items
+        /// </summary>
         public IEnumerable<ShortcutInfo> ItemsSource
         {
             get { return (IEnumerable<ShortcutInfo>)GetValue(ItemsSourceProperty); }
@@ -39,9 +44,13 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// The property for template of list items
+        /// Identifies the ItemTemplate bindable property
         /// </summary>
         public static readonly BindableProperty ItemTemplateProperty = BindableProperty.Create("ItemTemplate", typeof(DataTemplate), typeof(AppListView), default(DataTemplate));
+
+        /// <summary>
+        /// Gets or sets template of list items
+        /// </summary>
         public DataTemplate ItemTemplate
         {
             get { return (DataTemplate)GetValue(ItemTemplateProperty); }
@@ -49,12 +58,12 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// The total count of items in list
+        /// A count of items in list
         /// </summary>
         private int AppCount;
 
         /// <summary>
-        /// Checks first item in list is focused
+        /// A flag indicates whether first item in list is focused or not
         /// </summary>
         public bool IsFirstItemFocused
         {
@@ -70,21 +79,22 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Constructor
+        /// A constructor
+        /// Adds PropertyChanged event handler
         /// </summary>
         public AppListView()
         {
             InitializeComponent();
             AppCount = 0;
-            PropertyChanged += OnPropertyChanged;
+            PropertyChanged += AppListViewPropertyChanged;
         }
 
         /// <summary>
-        /// Handles AppListView Property Changed event
+        /// This method is called when the properties of AppListView is changed
         /// </summary>
         /// <param name="sender">The source of the event</param>
-        /// <param name="e">The event that is occured when property of AppListView is changed</param>
-        void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
+        /// <param name="e">The event that is occurred when property of AppListView is changed</param>
+        void AppListViewPropertyChanged(object sender, PropertyChangedEventArgs e)
         {
             if (e.PropertyName == "ItemsSource" || e.PropertyName == "ItemTemplate")
             {
@@ -93,7 +103,7 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Creates and Adds AppItemCells binded with ItemsSource
+        /// A method creates and adds AppItemCells binded with ItemsSource
         /// </summary>
         void CreateAppItemCells()
         {
@@ -142,9 +152,9 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Scrolls the list with spacing
+        /// A method scrolls the list with spacing
         /// </summary>
-        /// <param name="index">The index of focused item cell</param>
+        /// <param name="index">A index of focused item cell</param>
         private async void ScrollToIndex(int index)
         {
             if (AppUpperList.Children.Count > index)
@@ -178,8 +188,7 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Focusing Initialize
-        /// Focus first item in apps list
+        /// A method moves focus to first item in list
         /// </summary>
         public void InitializeFocus()
         {
index 5a77a792fa8778d6aac7c222175e6aa79eca8525..19e76b5cbd2d47f883bc1dcb21f1de9943652d1e 100644 (file)
@@ -21,22 +21,22 @@ using Xamarin.Forms;
 namespace TVApps.Controls
 {
     /// <summary>
-    /// Custom Button for TVButton to get pressed/release status
+    /// A custom control for TVButton to get pressed/release status
     /// </summary>
     public partial class CustomButton : Button
     {
         /// <summary>
-        /// The event handler for button released event
+        /// A event handler for button released event
         /// </summary>
         public EventHandler OnButtonUp;
 
         /// <summary>
-        /// The event handler for button pressed event
+        /// A event handler for button pressed event
         /// </summary>
         public EventHandler OnButtonDown;
 
         /// <summary>
-        /// Constructor
+        /// A constructor
         /// </summary>
         public CustomButton()
         {
index e657f4971909df59e55cb74e518af6ece9e7dd84..96cb0f48f3b727df503723d69f24df36dece80ab 100644 (file)
@@ -21,15 +21,19 @@ namespace TVApps.Controls
 {
 
     /// <summary>
-    /// Custom Control for Nine Patch Image
+    /// A custom control for displaying nine patch image
     /// </summary>
     [XamlCompilation(XamlCompilationOptions.Compile)]
     public partial class NinePatchImage : Image
     {
         /// <summary>
-        /// The property for left border of image
+        /// Identifies the BorderLeft bindable property
         /// </summary>
         public static readonly BindableProperty BorderLeftProperty = BindableProperty.Create("BorderLeft", typeof(int), typeof(NinePatchImage), default(int));
+
+        /// <summary>
+        /// Gets or sets left border of NinePatchImage
+        /// </summary>
         public int BorderLeft
         {
             get { return (int)GetValue(BorderLeftProperty); }
@@ -37,9 +41,13 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// The property for right border of image
+        /// Identifies the BorderRight bindable property
         /// </summary>
         public static readonly BindableProperty BorderRightProperty = BindableProperty.Create("BorderRight", typeof(int), typeof(NinePatchImage), default(int));
+
+        /// <summary>
+        /// Gets or sets right border of NinePatchImage
+        /// </summary>
         public int BorderRight
         {
             get { return (int)GetValue(BorderRightProperty); }
@@ -47,9 +55,13 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// The property for top border of image
+        /// Identifies the BorderTop bindable property
         /// </summary>
         public static readonly BindableProperty BorderTopProperty = BindableProperty.Create("BorderTop", typeof(int), typeof(NinePatchImage), default(int));
+
+        /// <summary>
+        /// Gets or sets top border of NinePatchImage
+        /// </summary>
         public int BorderTop
         {
             get { return (int)GetValue(BorderTopProperty); }
@@ -57,9 +69,13 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// The property for bottom border of image
+        /// Identifies the BorderBottom bindable property
         /// </summary>
         public static readonly BindableProperty BorderBottomProperty = BindableProperty.Create("BorderBottom", typeof(int), typeof(NinePatchImage), default(int));
+
+        /// <summary>
+        /// Gets or sets bottom border of NinePatchImage
+        /// </summary>
         public int BorderBottom
         {
             get { return (int)GetValue(BorderBottomProperty); }
@@ -67,7 +83,7 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Constructor
+        /// A constructor
         /// </summary>
         public NinePatchImage()
         {
index 52897908d01513ca6ae4cc610a934e68eca2a30e..00f1a517373b442536b1a0d2e95e9ed23d88d041 100644 (file)
@@ -21,12 +21,12 @@ using Xamarin.Forms;
 namespace TVApps.Controls
 {
     /// <summary>
-    /// TV Button Control
+    /// A custom control for buttons in footer of TV Apps
     /// </summary>
     public partial class TVButton : StackLayout
     {
         /// <summary>
-        /// The title of TVButton
+        /// Gets or sets text of TVButton
         /// </summary>
         public string Text
         {
@@ -35,14 +35,13 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// The bindable property for command
+        /// Identifies the Command bindable property
         /// </summary>
-        /// <see cref="Command"/>
-        public static readonly BindableProperty CommandProperty =
-           BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(TVButton), null, BindingMode.TwoWay);
+        public static readonly BindableProperty CommandProperty = BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(TVButton), null, BindingMode.TwoWay);
 
         /// <summary>
-        /// A command will be executed if the button is touched.
+        /// Gets or sets command of TV Button
+        /// The command will be executed if the button is touched
         /// </summary>
         public ICommand Command
         {
@@ -51,7 +50,7 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// A command parameter will be passed when the Command is executed.
+        /// A command parameter will be passed when the Command is executed
         /// </summary>
         /// <see cref="CommandButton.Command"/>
         public string CommandParameter
@@ -85,10 +84,10 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Handles Button Clicked event
+        /// This method is called when the TVButton is clicked
         /// </summary>
         /// <param name="sender">The source of the event</param>
-        /// <param name="e">The event that is occured when button is clicked</param>
+        /// <param name="e">The event that is occurred when button is clicked</param>
         private void ButtonClickListener(object sender, EventArgs e)
         {
             // Stops playing animation
@@ -123,10 +122,10 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Handles Button Focused event
+        /// This method is called when the TVButton receives focus
         /// </summary>
-        /// <param name="sender">The source of the event.</param>
-        /// <param name="e">The event that is occured when button is focused</param>
+        /// <param name="sender">The source of the event</param>
+        /// <param name="e">The event that is occurred when button is focused</param>
         private void ButtonFocusedListener(object sender, FocusEventArgs e)
         {
             // Stops playing animation
@@ -144,10 +143,10 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Handles Button Unfocused event
+        /// This method is called when the TVButton loses focus
         /// </summary>
         /// <param name="sender">The source of the event</param>
-        /// <param name="e">The event that is occured when button is unfocused</param>
+        /// <param name="e">The event that is occurred when button is unfocused</param>
         private void ButtonUnfocusedListener(object sender, FocusEventArgs e)
         {
             // Stops playing animation
@@ -165,10 +164,10 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Handles Button Up event
+        /// This method is called when the TVButton is released
         /// </summary>
         /// <param name="sender">The event sender</param>
-        /// <param name="e">The event that is occured when button is released</param>
+        /// <param name="e">The event that is occurred when button is released</param>
         public void ButtonUpListener(object sender, EventArgs e)
         {
             BackgroundImage.Source = ButtonImageReleased;
@@ -176,17 +175,17 @@ namespace TVApps.Controls
         }
 
         /// <summary>
-        /// Handles Button Down event
+        /// This method is called when the TVButton is pressed
         /// </summary>
         /// <param name="sender">The source of the event</param>
-        /// <param name="e">The event that is occured when button is pressed</param>
+        /// <param name="e">The event that is occurred when button is pressed</param>
         public void ButtonDownListener(object sender, EventArgs e)
         {
             BackgroundImage.Source = ButtonImagePressed;
         }
 
         /// <summary>
-        /// Positions and Sizes the children
+        /// A method positions and sizes the children
         /// </summary>
         /// <param name="x">The x position for the children</param>
         /// <param name="y">The y position for the children</param>