diff options
author | hongqingli <hongqing.li@samsung.com> | 2017-04-10 15:22:01 +0800 |
---|---|---|
committer | hongqingli <hongqing.li@samsung.com> | 2017-04-10 15:31:02 +0800 |
commit | a172d0f1ffaf710019a85d706222ce14113b1ad0 (patch) | |
tree | e516c6a3c9a845aae161fa80b8eee7776ea98b5f | |
parent | 8296554a5534a388540b27bacf84898361ab3f44 (diff) | |
download | elm-sharp-a172d0f1ffaf710019a85d706222ce14113b1ad0.tar.gz elm-sharp-a172d0f1ffaf710019a85d706222ce14113b1ad0.tar.bz2 elm-sharp-a172d0f1ffaf710019a85d706222ce14113b1ad0.zip |
add comments for Naviframe&NaviItem
Change-Id: Icde694cd199fade24b03a4366ff8a83b93cedb90
Signed-off-by: hongqingli <hongqing.li@samsung.com>
-rwxr-xr-x[-rw-r--r--] | ElmSharp/ElmSharp/NaviItem.cs | 23 | ||||
-rwxr-xr-x[-rw-r--r--] | ElmSharp/ElmSharp/Naviframe.cs | 103 |
2 files changed, 124 insertions, 2 deletions
diff --git a/ElmSharp/ElmSharp/NaviItem.cs b/ElmSharp/ElmSharp/NaviItem.cs index eabd003..f7da156 100644..100755 --- a/ElmSharp/ElmSharp/NaviItem.cs +++ b/ElmSharp/ElmSharp/NaviItem.cs @@ -18,6 +18,10 @@ using System; namespace ElmSharp { + /// <summary> + /// The NaviItem is a widget to contain the contents to show in Naviframe. + /// Inherits ItemObject + /// </summary> public class NaviItem : ItemObject { EvasObject _content; @@ -38,13 +42,22 @@ namespace ElmSharp Interop.Elementary.elm_naviframe_item_pop_cb_set(handle, _popped, IntPtr.Zero); } + /// <summary> + /// Popped will be triggered when NaviItem is removed. + /// </summary> public event EventHandler Popped; + /// <summary> + /// Gets the content object. The name of content part is "elm.swallow.content". + /// </summary> public EvasObject Content { get { return _content; } } + /// <summary> + /// Sets or gets a value whether title area is enabled or not. + /// </summary> public bool TitleBarVisible { get @@ -57,6 +70,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the title bar background color + /// </summary> public Color TitleBarBackgroundColor { get @@ -77,6 +93,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets an item style. + /// </summary> public string Style { get @@ -89,6 +108,10 @@ namespace ElmSharp } } + /// <summary> + /// Invalidate the EventArgs if _isPopped is false. + /// The method should be overridden in children class. + /// </summary> protected override void OnInvalidate() { if (!_isPopped) diff --git a/ElmSharp/ElmSharp/Naviframe.cs b/ElmSharp/ElmSharp/Naviframe.cs index 0f9b3eb..8d31756 100644..100755 --- a/ElmSharp/ElmSharp/Naviframe.cs +++ b/ElmSharp/ElmSharp/Naviframe.cs @@ -19,14 +19,30 @@ using System.Collections.Generic; namespace ElmSharp { + /// <summary> + /// The NaviframeEventArgs is a event args class for navi frame. + /// Inherits EventArgs + /// </summary> public class NaviframeEventArgs : EventArgs { + /// <summary> + /// Sets or gets the content object. The name of content part is "elm.swallow.content". + /// </summary> public EvasObject Content { get; set; } } + /// <summary> + /// Naviframe is a widget to stands for navigation frame. It's a views manager for applications. + /// Inherits Widget + /// </summary> public class Naviframe : Widget { SmartEvent _transitionFinished; readonly List<NaviItem> _itemStack = new List<NaviItem>(); + + /// <summary> + /// Creates and initializes a new instance of Naviframe class. + /// </summary> + /// <param name="parent">The parent is a given container which will be attached by Naviframe as a child. It's <see cref="EvasObject"/> type.</param> public Naviframe(EvasObject parent) : base(parent) { _transitionFinished = new SmartEvent(this, this.RealHandle, "transition,finished"); @@ -34,21 +50,32 @@ namespace ElmSharp } /// <summary> - /// + /// Popped will be triggered when NaviItem is removed. /// </summary> /// <remarks> /// It is always called when NaviItem was removed. /// (even if removed by NaviItem.Delete()) - /// This event will be invoked in progress of Pop/Delete operation. + /// This event will be invoked in progress of Pop/Delete operation. /// After called Popped event, Pop/Delete method will be returned /// </remarks> public event EventHandler<NaviframeEventArgs> Popped; + + /// <summary> + /// AnimationFinished will be triggered when animation is finished. + /// </summary> public event EventHandler AnimationFinished; + + /// <summary> + /// Gets the list of navi item + /// </summary> public IReadOnlyList<NaviItem> NavigationStack { get { return _itemStack; } } + /// <summary> + /// Sets or gets the the preserve content objects when items are popped. + /// </summary> public bool PreserveContentOnPop { get @@ -61,6 +88,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets whether the default back button is enabled + /// </summary> public bool DefaultBackButtonEnabled { get @@ -73,16 +103,36 @@ namespace ElmSharp } } + /// <summary> + /// Push a new item to the top of the naviframe stack and show it. + /// The title and style are null. + /// </summary> + /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param> + /// <returns>The created item or null upon failure.</returns> public NaviItem Push(EvasObject content) { return Push(content, null); } + /// <summary> + /// Push a new item to the top of the naviframe stack and show it. + /// The style are null. + /// </summary> + /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param> + /// <param name="title">The current item title. null would be default.</param> + /// <returns></returns> public NaviItem Push(EvasObject content, string title) { return Push(content, title, null); } + /// <summary> + /// Push a new item to the top of the naviframe stack and show it. + /// </summary> + /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param> + /// <param name="title">The current item title. null would be default.</param> + /// <param name="style">The current item style name. null would be default.</param> + /// <returns>The created item or null upon failure.</returns> public NaviItem Push(EvasObject content, string title, string style) { IntPtr item = Interop.Elementary.elm_naviframe_item_push(RealHandle, title, IntPtr.Zero, IntPtr.Zero, content.Handle, style); @@ -92,16 +142,39 @@ namespace ElmSharp return naviItem; } + /// <summary> + /// Insert a new item into the naviframe before item. + /// The title is "" and the style is null. + /// </summary> + /// <param name="before">The item which the new item is inserted before.</param> + /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param> + /// <returns>The created item or null upon failure.</returns> public NaviItem InsertBefore(NaviItem before, EvasObject content) { return InsertBefore(before, content, ""); } + /// <summary> + /// Insert a new item into the naviframe before item. + /// The style is null. + /// </summary> + /// <param name="before">The item which the new item is inserted before.</param> + /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param> + /// <param name="title">The current item title. null would be default.</param> + /// <returns>The created item or null upon failure.</returns> public NaviItem InsertBefore(NaviItem before, EvasObject content, string title) { return InsertBefore(before, content, title, null); } + /// <summary> + /// Insert a new item into the naviframe before item. + /// </summary> + /// <param name="before">The item which the new item is inserted before.</param> + /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param> + /// <param name="title">The current item title. null would be default.</param> + /// <param name="style">The current item style name. null would be default.</param> + /// <returns>The created item or null upon failure.</returns> public NaviItem InsertBefore(NaviItem before, EvasObject content, string title, string style) { IntPtr item = Interop.Elementary.elm_naviframe_item_insert_before(RealHandle, before, title, IntPtr.Zero, IntPtr.Zero, content, null); @@ -112,16 +185,39 @@ namespace ElmSharp return naviItem; } + /// <summary> + /// Insert a new item into the naviframe after item. + /// The title is "" and the style is null. + /// </summary> + /// <param name="after">The item which the new item is inserted after.</param> + /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param> + /// <returns>The created item or null upon failure.</returns> public NaviItem InsertAfter(NaviItem after, EvasObject content) { return InsertAfter(after, content, ""); } + /// <summary> + /// Insert a new item into the naviframe after item. + /// The style is null. + /// </summary> + /// <param name="after">The item which the new item is inserted after.</param> + /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param> + /// <param name="title">The current item title. null would be default.</param> + /// <returns>The created item or null upon failure.</returns> public NaviItem InsertAfter(NaviItem after, EvasObject content, string title) { return InsertAfter(after, content, title, null); } + /// <summary> + /// Insert a new item into the naviframe after item. + /// </summary> + /// <param name="after">The item which the new item is inserted after.</param> + /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param> + /// <param name="title">The current item title. null would be default.</param> + /// <param name="style">The current item style name. null would be default.</param> + /// <returns>The created item or null upon failure.</returns> public NaviItem InsertAfter(NaviItem after, EvasObject content, string title, string style) { IntPtr item = Interop.Elementary.elm_naviframe_item_insert_after(RealHandle, after, title, IntPtr.Zero, IntPtr.Zero, content, null); @@ -132,6 +228,9 @@ namespace ElmSharp return naviItem; } + /// <summary> + /// Pop an item that is on top of the stack. + /// </summary> public void Pop() { Interop.Elementary.elm_naviframe_item_pop(RealHandle); |