public void InitEventWatcher()
        {
            var rBoundEvent = DataBindingTypeResolve.MakeViewDataBindingEvent(this.gameObject, this.EventPath);

            if (rBoundEvent != null)
            {
                this.mUnityEventWatcher = new UnityEventWatcher(rBoundEvent.Component, rBoundEvent.Name, this.SyncFromView);
            }
            else
            {
                Debug.LogErrorFormat("Can not parse bound event: {0}.", this.EventPath);
            }
        }
Beispiel #2
0
        public void InitEventWatcher(Action <EventArg> rAction)
        {
            var rBoundEvent = DataBindingTypeResolve.MakeViewDataBindingEvent(this.gameObject, this.ViewEvent);

            if (rBoundEvent != null)
            {
                this.mUnityEventWatcher = new UnityEventWatcher(rBoundEvent.Component, rBoundEvent.Name, rAction);
            }
            else
            {
                Debug.LogErrorFormat("Can not parse bound event: {0}.", this.ViewEvent);
            }
        }
        public override void GetPaths()
        {
            base.GetPaths();

            var rViewModelProps = new List <BindableMember <PropertyInfo> >(
                DataBindingTypeResolve.GetListViewModelProperties(this.gameObject));

            this.ModelPaths = DataBindingTypeResolve.GetAllViewModelPaths(rViewModelProps).ToArray();

            if (string.IsNullOrEmpty(this.ViewModelPath))
            {
                this.ViewModelPath = this.ModelPaths.Length > 0 ? this.ModelPaths[0] : "";
            }
        }
 public void GetPaths()
 {
     ViewModelClasses = DataBindingTypeResolve.GetAllViewModels().ToArray();
 }
Beispiel #5
0
 public virtual void GetPaths()
 {
     this.TemplateViewModels = DataBindingTypeResolve.GetAllViewModels().ToArray();
 }
 public void GetAllViewModelDataSources()
 {
     this.ViewModels       = new List <ViewModelDataSource>(this.GetComponentsInChildren <ViewModelDataSource>(true));
     this.EventBindings    = new List <EventBinding>(this.GetComponentsInChildren <EventBinding>(true));
     this.ViewModelClasses = DataBindingTypeResolve.GetAllViews().ToArray();
 }
        public UnityEventWatcher(Component rComp, string rEventName, Action <EventArg> rAction)
        {
            var rBindableEvent = DataBindingTypeResolve.GetBoundEvent(rEventName, rComp);

            this.mUnityEventBinder = UnityEventBinderFactory.Create(rBindableEvent?.UnityEvent, rAction);
        }
Beispiel #8
0
 public void GetAllViewModelDataSources()
 {
     ViewModels            = new List <ViewModelDataSource>(GetComponentsInChildren <ViewModelDataSource>(true));
     EventBindings         = new List <EventBinding>(GetComponentsInChildren <EventBinding>(true));
     ViewControllerClasses = DataBindingTypeResolve.GetAllViews().ToArray();
 }
Beispiel #9
0
        public void InitEventWatcher()
        {
            var rBoundEvent = DataBindingTypeResolve.MakeViewDataBindingEvent(this.gameObject, this.EventPath);

            this.mUnityEventWatcher = new UnityEventWatcher(rBoundEvent.Component, rBoundEvent.Name, this.SyncFromView);
        }