Пример #1
0
 /// <summary>
 /// Before calling the mapping action.
 /// </summary>
 /// <param name="ownerType">Type of the owner.</param>
 /// <param name="method">The method.</param>
 /// <param name="mapping">The mapping.</param>
 /// <param name="payload">The payload.</param>
 protected internal virtual bool BeforeAction(
     Type ownerType, MethodInfo method,
     RegionMapping mapping, RegionViewMappingPayload payload)
 {
     // TODO
     return(true);
 }
Пример #2
0
        protected static void MapView(RegionMapping mapping, RegionViewMappingPayload vmp)
        {
            var vm = vmp.View != null?
                     mapping.MapView(vmp.View) :
                         mapping.MapView(vmp.PrefabName);

            vm.DataContext = vmp.DataContext;
        }
Пример #3
0
 protected static void ShowView(RegionMapping mapping, RegionViewMappingPayload vmp)
 {
     if (vmp.View != null)
     {
         mapping.ShowView(mapping, vmp.View);
     }
     else
     {
         mapping.ShowView(mapping, vmp.PrefabName);
     }
 }
Пример #4
0
        public virtual ViewMapping HideView(RegionMapping target, string prefabName)
        {
            var adapter = GetRegionAdapter();

            if (adapter == null)
            {
                return(null);
            }

            var vm = adapter.HideView(this, prefabName);

            return(vm);
        }
Пример #5
0
        public virtual ViewMapping HideView(RegionMapping target, GameObject view)
        {
            var adapter = GetRegionAdapter();

            if (adapter == null)
            {
                return(null);
            }

            var vm = adapter.HideView(this, view);

            return(vm);
        }
Пример #6
0
        /// <summary>
        /// Invokes the region view mapping action.
        /// </summary>
        /// <param name="method">The method.</param>
        /// <param name="attribute">The attribute.</param>
        /// <param name="mapping">The mapping.</param>
        /// <param name="payload">The payload.</param>
        protected static void InvokeRegionViewMappingAction(
            MethodInfo method, ViewMappingActionAttribute attribute,
            RegionMapping mapping, RegionViewMappingPayload payload)
        {
            var canProceed = attribute.BeforeAction(method.DeclaringType, method, mapping, payload);

            if (!canProceed)
            {
                return;
            }

            method.Invoke(mapping, new object[] { mapping, payload });

            attribute.AfterAction(method.DeclaringType, method, mapping, payload);
        }
Пример #7
0
 protected static void UpdateDataContext(RegionMapping mapping, RegionViewMappingPayload vmp)
 {
     mapping.UpdateDataContext(vmp.DataContext);
 }
Пример #8
0
 protected static void HideAllViews(RegionMapping mapping, RegionViewMappingPayload vmp)
 {
     mapping.HideAllViews();
 }
Пример #9
0
 protected static void HideView(RegionMapping mapping, RegionViewMappingPayload vmp)
 {
 }
Пример #10
0
 public virtual void OnViewShown(RegionMapping regionHost, GameObject view)
 {
     // TODO
 }
Пример #11
0
 protected static void UnlockView(RegionMapping mapping, RegionViewMappingPayload vmp)
 {
     // TODO pass specific view
     mapping.Unlock();
 }
Пример #12
0
 protected static void DestroyRegion(RegionMapping mapping, RegionViewMappingPayload vmp)
 {
     mapping.DestroyRegion();
 }
Пример #13
0
 public void OnViewUnlocked(RegionMapping target, GameObject view)
 {
     // TODO
 }
Пример #14
0
 public virtual void OnDataContextChange(RegionMapping regionHost, GameObject view, object oldValue, object newValue)
 {
     // TODO
 }
Пример #15
0
 protected static void UnlockAllViews(RegionMapping mapping, RegionViewMappingPayload vmp)
 {
     mapping.Unlock();
 }
Пример #16
0
 /// <summary>
 /// Afters the action.
 /// </summary>
 /// <param name="ownerType">Type of the owner.</param>
 /// <param name="method">The method.</param>
 /// <param name="mapping">The mapping.</param>
 /// <param name="payload">The payload.</param>
 protected internal virtual void AfterAction(
     Type ownerType, MethodInfo method,
     RegionMapping mapping, RegionViewMappingPayload payload)
 {
     // TODO
 }
Пример #17
0
 public virtual void OnViewUnmapped(RegionMapping regionHost, GameObject view)
 {
     // TODO
 }