summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruno da Silva Belo <brunodasilvabelo@gmail.com>2019-10-14 18:33:01 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-10-14 18:36:56 -0300
commit0cfcfd30987f74130d840162f8e09ce7830e460b (patch)
tree7c579b05e118d59d69a53f87426ac6a6befbe58f /src
parent53e1d3ad08cda904bd52e1e1fc187bc8315f3693 (diff)
csharp: updating GenericModel.cs docs.
Reviewers: lauromoura, felipealmeida, segfaultxavi, woohyun Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8345 Differential Revision: https://phab.enlightenment.org/D10376
Diffstat (limited to 'src')
-rw-r--r--src/bindings/mono/efl_mono/GenericModel.cs37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/bindings/mono/efl_mono/GenericModel.cs b/src/bindings/mono/efl_mono/GenericModel.cs
index b9ef325..2da3da6 100644
--- a/src/bindings/mono/efl_mono/GenericModel.cs
+++ b/src/bindings/mono/efl_mono/GenericModel.cs
@@ -15,8 +15,6 @@ namespace Efl {
15/// <para>It provides an expanded API like async helpers to get children.</para> 15/// <para>It provides an expanded API like async helpers to get children.</para>
16/// 16///
17/// <para>For MVVM-based models, <see cref="Efl.UserModel&lt;T&gt;" /> provides a simpler API.</para> 17/// <para>For MVVM-based models, <see cref="Efl.UserModel&lt;T&gt;" /> provides a simpler API.</para>
18///
19/// <para>Since EFL 1.24.</para>
20/// </summary> 18/// </summary>
21/// <typeparam name="T">The type of the child model. It is the type used when adding/removing/getting items to this 19/// <typeparam name="T">The type of the child model. It is the type used when adding/removing/getting items to this
22/// model.</typeparam> 20/// model.</typeparam>
@@ -25,6 +23,8 @@ public class GenericModel<T> : Efl.Object, Efl.IModel, IDisposable
25 private Efl.IModel model; 23 private Efl.IModel model;
26 24
27 /// <summary>Creates a new model wrapping <c>model</c>.</summary> 25 /// <summary>Creates a new model wrapping <c>model</c>.</summary>
26 /// <param name="model">The model to be wrapped.</param>
27 /// <param name="parent">The parent of the model.</param>
28 public GenericModel (Efl.IModel model, Efl.Object parent = null) : base(parent) 28 public GenericModel (Efl.IModel model, Efl.Object parent = null) : base(parent)
29 { 29 {
30 this.model = model; 30 this.model = model;
@@ -43,42 +43,57 @@ public class GenericModel<T> : Efl.Object, Efl.IModel, IDisposable
43 } 43 }
44 44
45 /// <summary>The list of properties available in the wrapped model.</summary> 45 /// <summary>The list of properties available in the wrapped model.</summary>
46 /// <returns>The list of properties in the model.</returns>
46 public Eina.Iterator<System.String> GetProperties() 47 public Eina.Iterator<System.String> GetProperties()
47 { 48 {
48 return model.GetProperties(); 49 return model.GetProperties();
49 } 50 }
50 51
51 /// <summary>Gets the value of the given property in the wrapped model.</summary> 52 /// <summary>Gets the value of the given property in the wrapped model.</summary>
53 /// <param name="property">The property of the model.</param>
54 /// <returns>The value of the property.</returns>
52 public Eina.Value GetProperty( System.String property) 55 public Eina.Value GetProperty( System.String property)
53 { 56 {
54 return model.GetProperty(property); 57 return model.GetProperty(property);
55 } 58 }
56 59
57 /// <summary>Sets the value of the given property in the given model.</summary> 60 /// <summary>Sets the value of the given property in the given model.</summary>
61 /// <param name="property">The property of the model.</param>
62 /// <param name="value">The value of the property.</param>
63 /// <returns>An <see cref="Eina.Future" /> that resolves when the property has
64 /// been set or reports an error if it could not be set.</returns>
58 public Eina.Future SetProperty( System.String property, Eina.Value value) 65 public Eina.Future SetProperty( System.String property, Eina.Value value)
59 { 66 {
60 return model.SetProperty(property, value); 67 return model.SetProperty(property, value);
61 } 68 }
62 69
63 /// <summary>Returns the number of children in the wrapped model.</summary> 70 /// <summary>Returns the number of children in the wrapped model.</summary>
71 /// <returns>The number of children.</returns>
64 public uint GetChildrenCount() 72 public uint GetChildrenCount()
65 { 73 {
66 return model.GetChildrenCount(); 74 return model.GetChildrenCount();
67 } 75 }
68 76
69 /// <summary>Returns an <see cref="Eina.Future" /> that will resolve when the property is ready to be read.</summary> 77 /// <summary>Returns an <see cref="Eina.Future" /> that will resolve when the property is ready to be read.</summary>
78 /// <param name="property">The property of the model.</param>
79 /// <returns>An <see cref="Eina.Future" /> that resolves when the property is ready.</returns>
70 public Eina.Future GetPropertyReady( System.String property) 80 public Eina.Future GetPropertyReady( System.String property)
71 { 81 {
72 return model.GetPropertyReady(property); 82 return model.GetPropertyReady(property);
73 } 83 }
74 84
75 /// <summary>Gets a number of children from the wrapped model.</summary> 85 /// <summary>Gets a number of children from the wrapped model.</summary>
86 /// <param name="start">The start of the range.</param>
87 /// <param name="count">The size of the range.</param>
88 /// <returns>An <see cref="Eina.Future" /> that resolves to an
89 /// <see cref="Eina.Array" /> of children models.</returns>
76 public Eina.Future GetChildrenSlice( uint start, uint count) 90 public Eina.Future GetChildrenSlice( uint start, uint count)
77 { 91 {
78 return model.GetChildrenSlice(start, count); 92 return model.GetChildrenSlice(start, count);
79 } 93 }
80 94
81 /// <summary>Adds a new object to the wrapper model.</summary> 95 /// <summary>Adds a new object to the wrapper model.</summary>
96 /// <param name="o">The object to get the properties from.</param>
82 public void Add(T o) 97 public void Add(T o)
83 { 98 {
84 Efl.IModel child = (Efl.IModel)this.AddChild(); 99 Efl.IModel child = (Efl.IModel)this.AddChild();
@@ -86,18 +101,22 @@ public class GenericModel<T> : Efl.Object, Efl.IModel, IDisposable
86 } 101 }
87 102
88 /// <summary>Adds a new child to the model and returns it.</summary> 103 /// <summary>Adds a new child to the model and returns it.</summary>
104 /// <returns>The object to be wrapped.</returns>
89 public Efl.Object AddChild() 105 public Efl.Object AddChild()
90 { 106 {
91 return model.AddChild(); 107 return model.AddChild();
92 } 108 }
93 109
94 /// <summary>Deletes the given <c>child</c> from the wrapped model.</summary> 110 /// <summary>Deletes the given <c>child</c> from the wrapped model.</summary>
111 /// <param name="child">The child to be deleted.</param>
95 public void DelChild( Efl.Object child) 112 public void DelChild( Efl.Object child)
96 { 113 {
97 model.DelChild(child); 114 model.DelChild(child);
98 } 115 }
99 116
100 /// <summary>Gets the element at the specified <c>index</c>.</summary> 117 /// <summary>Gets the element at the specified <c>index</c>.</summary>
118 /// <param name="index">The position of the element.</param>
119 /// <returns>Token to notify the async operation of external request to cancel.</returns>
101 async public System.Threading.Tasks.Task<T> GetAtAsync(uint index) 120 async public System.Threading.Tasks.Task<T> GetAtAsync(uint index)
102 { 121 {
103 using (Eina.Value v = await GetChildrenSliceAsync(index, 1)) 122 using (Eina.Value v = await GetChildrenSliceAsync(index, 1))
@@ -117,18 +136,32 @@ public class GenericModel<T> : Efl.Object, Efl.IModel, IDisposable
117 } 136 }
118 137
119 /// <summary>Async wrapper around <see cref="SetProperty(System.String, Eina.Value)" />.</summary> 138 /// <summary>Async wrapper around <see cref="SetProperty(System.String, Eina.Value)" />.</summary>
139 /// <param name="property">The property to be added.</param>
140 /// <param name="value">The value of the property.</param>
141 /// <param name="token">The token for the task's cancellation.</param>
142 /// <returns>Task that resolves when the property has been set or could not
143 /// be set.</returns>
120 public System.Threading.Tasks.Task<Eina.Value> SetPropertyAsync( System.String property, Eina.Value value, System.Threading.CancellationToken token=default(System.Threading.CancellationToken)) 144 public System.Threading.Tasks.Task<Eina.Value> SetPropertyAsync( System.String property, Eina.Value value, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
121 { 145 {
122 return model.SetPropertyAsync(property, value, token); 146 return model.SetPropertyAsync(property, value, token);
123 } 147 }
124 148
125 /// <summary>Async wrapper around <see cref="GetPropertyReady(System.String)" />.</summary> 149 /// <summary>Async wrapper around <see cref="GetPropertyReady(System.String)" />.</summary>
150 /// <param name="property">The property of the model.</param>
151 /// <param name="token">The token for the task's cancellation.</param>
152 /// <returns>Task that resolves when the given property is ready to be
153 /// read.</returns>
126 public System.Threading.Tasks.Task<Eina.Value> GetPropertyReadyAsync( System.String property, System.Threading.CancellationToken token=default(System.Threading.CancellationToken)) 154 public System.Threading.Tasks.Task<Eina.Value> GetPropertyReadyAsync( System.String property, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
127 { 155 {
128 return model.GetPropertyReadyAsync(property, token); 156 return model.GetPropertyReadyAsync(property, token);
129 } 157 }
130 158
131 /// <summary>Async wrapper around <see cref="GetChildrenSlice(uint, uint)" />.</summary> 159 /// <summary>Async wrapper around <see cref="GetChildrenSlice(uint, uint)" />.</summary>
160 /// <param name="start">The start of the range.</param>
161 /// <param name="count">The size of the range.</param>
162 /// <param name="token">Token to notify the async operation of external request to cancel.</param>
163 /// <returns>Task that resolves when the desired <see cref="Eina.Array" /> of
164 /// children models is ready.</returns>
132 public System.Threading.Tasks.Task<Eina.Value> GetChildrenSliceAsync( uint start, uint count, System.Threading.CancellationToken token=default(System.Threading.CancellationToken)) 165 public System.Threading.Tasks.Task<Eina.Value> GetChildrenSliceAsync( uint start, uint count, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
133 { 166 {
134 return model.GetChildrenSliceAsync(start, count, token); 167 return model.GetChildrenSliceAsync(start, count, token);