Example #1
0
            /// <summary>Create a UI object from the necessary properties in the specified model and generate the created event on the factory when the object is done building. This function must be use by all <see cref="Efl.Ui.IView"/> that need to create object. They should not use <see cref="Efl.Ui.IFactory.Create"/> directly.</summary>
            /// <param name="factory">The factory to use for requesting the new object from and generating the created event onto.</param>
            /// <param name="models">Efl iterator providing the model to be associated to the new item. It should remain valid until the end of the function call.</param>
            /// <param name="parent">Efl canvas</param>
            /// <returns>Created UI object</returns>
            public static Eina.Future CreateWithEvent(Efl.Ui.IFactory factory, Eina.Iterator <Efl.IModel> models, Efl.Gfx.IEntity parent)
            {
                var _in_models = models.Handle;
                var _ret_var   = Efl.Ui.ViewFactory.NativeMethods.efl_ui_view_factory_create_with_event_ptr.Value.Delegate(factory, _in_models, parent);

                Eina.Error.RaiseIfUnhandledException();
                return(_ret_var);
            }
Example #2
0
 private static void factory_bind(System.IntPtr obj, System.IntPtr pd, System.String key, Efl.Ui.IFactory factory)
 {
     Eina.Log.Debug("function efl_ui_factory_bind was called");
     Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
     if (wrapper != null)
     {
         try {
             ((IFactoryBind)wrapper).FactoryBind(key, factory);
         } catch (Exception e) {
             Eina.Log.Warning($"Callback error: {e.ToString()}");
             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
         }
     }
     else
     {
         efl_ui_factory_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key, factory);
     }
 }
Example #3
0
 /// <summary>bind the factory with the given key string. when the data is ready or changed, factory create the object and bind the data to the key action and process promised work. Note: the input <see cref="Efl.Ui.IFactory"/> need to be <see cref="Efl.Ui.IPropertyBind.PropertyBind"/> at least once.</summary>
 /// <param name="key">Key string for bind model property data</param>
 /// <param name="factory"><see cref="Efl.Ui.IFactory"/> for create and bind model property data</param>
 /// <returns></returns>
 public void FactoryBind(System.String key, Efl.Ui.IFactory factory)
 {
     Efl.Ui.IFactoryBindNativeInherit.efl_ui_factory_bind_ptr.Value.Delegate(this.NativeHandle, key, factory);
     Eina.Error.RaiseIfUnhandledException();
 }
Example #4
0
 /// <summary>Binds the given factory to this part.
 /// </summary>
 /// <param name="factory">The factory to be used.</param>
 public Eina.Error BindFactory(Efl.Ui.IFactory factory)
 {
     return(this.Binder.BindFactory(this.PartName, factory));
 }
Example #5
0
 /// <summary>bind the factory with the given key string. when the data is ready or changed, factory create the object and bind the data to the key action and process promised work. Note: the input <see cref="Efl.Ui.IFactory"/> need to be <see cref="Efl.Ui.IPropertyBind.PropertyBind"/> at least once.</summary>
 /// <param name="key">Key string for bind model property data</param>
 /// <param name="factory"><see cref="Efl.Ui.IFactory"/> for create and bind model property data</param>
 virtual public void FactoryBind(System.String key, Efl.Ui.IFactory factory)
 {
     Efl.Ui.IFactoryBindConcrete.NativeMethods.efl_ui_factory_bind_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), key, factory);
     Eina.Error.RaiseIfUnhandledException();
 }
Example #6
0
 /// <summary>Binds the given factory to this part.</summary>
 public Eina.Error BindFactory(Efl.Ui.IFactory factory)
 {
     this.Binder.FactoryBind(this.PartName, factory);
     return(Eina.Error.NO_ERROR);
 }
Example #7
0
                private static Eina.Future create_with_event(System.IntPtr obj, System.IntPtr pd, Efl.Ui.IFactory factory, System.IntPtr models, Efl.Gfx.IEntity parent)
                {
                    Eina.Log.Debug("function efl_ui_view_factory_create_with_event was called");

                    var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);

                    if (ws != null)
                    {
                        var         _in_models = new Eina.Iterator <Efl.IModel>(models, false);
                        Eina.Future _ret_var   = default(Eina.Future);
                        try
                        {
                            _ret_var = ViewFactory.CreateWithEvent(factory, _in_models, parent);
                        }
                        catch (Exception e)
                        {
                            Eina.Log.Warning($"Callback error: {e.ToString()}");
                            Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
                        }

                        return(_ret_var);
                    }
                    else
                    {
                        return(efl_ui_view_factory_create_with_event_ptr.Value.Delegate(factory, models, parent));
                    }
                }