Class Efl.LoopModel
Inheritance
Syntax
public abstract class LoopModel : LoopConsumer, IModel, IWrapper, IDisposable
Constructors
LoopModel(EoWrapper.ConstructingHandle)
Subclasses should override this constructor if they are expected to be instantiated from native code. Do not call this constructor directly.
Declaration
protected LoopModel(EoWrapper.ConstructingHandle ch)
Parameters
Type | Name | Description |
---|---|---|
Efl.Eo.EoWrapper.ConstructingHandle | ch | Tag struct storing the native handle of the object being constructed. |
LoopModel(Object)
Initializes a new instance of the Efl.LoopModel class.
Declaration
public LoopModel(Object parent = null)
Parameters
Type | Name | Description |
---|---|---|
Efl.Object | parent | Parent instance. |
LoopModel(IntPtr, Object)
Initializes a new instance of the Efl.LoopModel class. Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.
Declaration
protected LoopModel(IntPtr baseKlass, Object parent)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | baseKlass | The pointer to the base native Eo class. |
Efl.Object | parent | The Efl.Object parent of this instance. |
Properties
ChildrenCount
Number of children. After @[.properties,changed] is emitted, Efl.IModel.GetChildrenCount() can be used to get the number of children. Efl.IModel.GetChildrenCount() can also be used before calling Efl.IModel.GetChildrenSlice(System.UInt32, System.UInt32) so a valid range is known. Event Efl.IModel.ChildrenCountChangedEvent is emitted when count is finished.
See also Efl.IModel.GetChildrenSlice(System.UInt32, System.UInt32).
Declaration
public uint ChildrenCount { get; }
Property Value
Type | Description |
---|---|
System.UInt32 | Current known children count |
Properties
Get properties from model. Properties_get is due to provide callers a way the fetch the current properties implemented/used by the model. The event Efl.IModel.PropertiesChangedEvent will be raised to notify listeners of any modifications in the properties.
See also Efl.IModel.PropertiesChangedEvent.
Declaration
public Iterator<string> Properties { get; }
Property Value
Type | Description |
---|---|
Eina.Iterator<System.String> | Array of current properties |
Methods
AddChild()
Add a new child. Add a new child, possibly dummy, depending on the implementation, of a internal keeping. When the child is effectively added the event Efl.IModel.ChildAddedEvent (object still in beta stage) is then raised and the new child is kept along with other children.
Declaration
public virtual Object AddChild()
Returns
Type | Description |
---|---|
Efl.Object | Child object |
DelChild(Object)
Remove a child. Remove a child of a internal keeping. When the child is effectively removed the event Efl.IModel.ChildRemovedEvent (object still in beta stage) is then raised to give a chance for listeners to perform any cleanup and/or update references.
Declaration
public virtual void DelChild(Object child)
Parameters
Type | Name | Description |
---|---|---|
Efl.Object | child | Child to be removed |
GetChildrenCount()
Number of children. After @[.properties,changed] is emitted, Efl.IModel.GetChildrenCount() can be used to get the number of children. Efl.IModel.GetChildrenCount() can also be used before calling Efl.IModel.GetChildrenSlice(System.UInt32, System.UInt32) so a valid range is known. Event Efl.IModel.ChildrenCountChangedEvent is emitted when count is finished.
See also Efl.IModel.GetChildrenSlice(System.UInt32, System.UInt32).
Declaration
public virtual uint GetChildrenCount()
Returns
Type | Description |
---|---|
System.UInt32 | Current known children count |
GetChildrenSlice(UInt32, UInt32)
Get children slice OR full range.
Efl.IModel.GetChildrenSlice(System.UInt32, System.UInt32) behaves in two different ways, it may provide the slice if count
is non-zero OR full range otherwise.
Since 'slice' is a range, for example if we have 20 children a slice could be the range from 3(start) with 4(count), see:
child 0 [no] child 1 [no] child 2 [no] child 3 [yes] child 4 [yes] child 5 [yes] child 6 [yes] child 7 [no]
Optionally the user can call Efl.IModel.GetChildrenCount() to know the number of children so a valid range can be known in advance.
See Efl.IModel.GetChildrenCount()
Note: The returned children will live only as long as the future itself. Once the future is done, if you want to keep the object alive, you need to take a reference for yourself.
Declaration
public virtual Future GetChildrenSlice(uint start, uint count)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | start | Range begin - start from here. |
System.UInt32 | count | Range size. If count is 0, start is ignored. |
Returns
Type | Description |
---|---|
Eina.Future | Array of children |
GetChildrenSliceAsync(UInt32, UInt32, CancellationToken)
Async wrapper for Efl.LoopModel.GetChildrenSlice(System.UInt32, System.UInt32).
Declaration
public Task<Value> GetChildrenSliceAsync(uint start, uint count, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | start | Range begin - start from here. |
System.UInt32 | count | Range size. If count is 0, start is ignored. |
System.Threading.CancellationToken | token | Token to notify the async operation of external request to cancel. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Eina.Value> | An async task wrapping the result of the operation. |
GetProperties()
Get properties from model. Properties_get is due to provide callers a way the fetch the current properties implemented/used by the model. The event Efl.IModel.PropertiesChangedEvent will be raised to notify listeners of any modifications in the properties.
See also Efl.IModel.PropertiesChangedEvent.
Declaration
public virtual Iterator<string> GetProperties()
Returns
Type | Description |
---|---|
Eina.Iterator<System.String> | Array of current properties |
GetProperty(String)
Retrieve the value of a given property name. At this point the caller is free to get values from properties. The event Efl.IModel.PropertiesChangedEvent may be raised to notify listeners of the property/value.
See Efl.IModel.GetProperties(), Efl.IModel.PropertiesChangedEvent
Declaration
public virtual Value GetProperty(string property)
Parameters
Type | Name | Description |
---|---|---|
System.String | property | Property name |
Returns
Type | Description |
---|---|
Eina.Value | Property value |
GetPropertyReady(String)
Get a future value when it changes to something that is not error:EAGAIN Efl.IModel.GetProperty(System.String) can return an error with code EAGAIN when it doesn't have any meaningful value. To make life easier, this future will resolve when the error:EAGAIN disappears. Either into a failed future in case the error code changed to something else or a success with the value of the property whenever the property finally changes.
The future can also be canceled if the model itself gets destroyed.
Declaration
public virtual Future GetPropertyReady(string property)
Parameters
Type | Name | Description |
---|---|---|
System.String | property | Property name. |
Returns
Type | Description |
---|---|
Eina.Future | Future to be resolved when the property changes to anything other than error:EAGAIN |
GetPropertyReadyAsync(String, CancellationToken)
Async wrapper for Efl.LoopModel.GetPropertyReady(System.String).
Declaration
public Task<Value> GetPropertyReadyAsync(string property, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | property | Property name. |
System.Threading.CancellationToken | token | Token to notify the async operation of external request to cancel. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Eina.Value> | An async task wrapping the result of the operation. |
OnChildrenCountChangedEvent(EventArgs)
Method to raise event ChildrenCountChangedEvent.
Declaration
public void OnChildrenCountChangedEvent(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | Event to raise. |
OnPropertiesChangedEvent(ModelPropertiesChangedEventArgs)
Method to raise event PropertiesChangedEvent.
Declaration
public void OnPropertiesChangedEvent(ModelPropertiesChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Efl.ModelPropertiesChangedEventArgs | e | Event to raise. |
SetProperty(String, Value)
Set a property value of a given property name. The caller must first read Efl.IModel.GetProperties() to obtain the list of available properties before being able to access them through Efl.IModel.GetProperty(System.String). This function sets a new property value into given property name. Once the operation is completed the concrete implementation should raise Efl.IModel.PropertiesChangedEvent event in order to notify listeners of the new value of the property.
If the model doesn't have the property then there are two possibilities, either raise an error or create the new property in model
See Efl.IModel.GetProperty(System.String), Efl.IModel.PropertiesChangedEvent
Declaration
public virtual Future SetProperty(string property, Value value)
Parameters
Type | Name | Description |
---|---|---|
System.String | property | Property name |
Eina.Value | value | Property value |
Returns
Type | Description |
---|---|
Eina.Future | Return an error in case the property could not be set, or the value that was set otherwise. |
SetPropertyAsync(String, Value, CancellationToken)
Async wrapper for Efl.LoopModel.SetProperty(System.String, Eina.Value).
Declaration
public Task<Value> SetPropertyAsync(string property, Value value, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | property | Property name |
Eina.Value | value | Property value |
System.Threading.CancellationToken | token | Token to notify the async operation of external request to cancel. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Eina.Value> | An async task wrapping the result of the operation. |
VolatileMake()
To be called when a Child model is created by Efl.IModel.GetChildrenSlice(System.UInt32, System.UInt32) by the one creating the child object. This function is used to properly define the lifecycle of the new Child Model object and make sure that once it has 0 ref except its parent Model, it will be destroyed. This function should only be called once per child. It is useful for Efl.IModel who have a lot of children and shouldn't keep more than what is used in memory.
Declaration
public virtual void VolatileMake()
Events
ChildrenCountChangedEvent
Event dispatched when children count is finished.
Declaration
public event EventHandler ChildrenCountChangedEvent
Event Type
Type | Description |
---|---|
System.EventHandler |
PropertiesChangedEvent
Event dispatched when properties list is available.
Declaration
public event EventHandler<ModelPropertiesChangedEventArgs> PropertiesChangedEvent
Event Type
Type | Description |
---|---|
System.EventHandler<Efl.ModelPropertiesChangedEventArgs> |