Example #1
0
        protected virtual object AllocateView(IEntity entity, ViewComponent viewComponent)
        {
            var viewToAllocate = ViewPool.AllocateInstance();

            viewComponent.View = viewToAllocate;
            OnViewAllocated(viewToAllocate, entity);

            return(viewToAllocate);
        }
Example #2
0
        protected virtual void RecycleView(IEntity entity, ViewComponent viewComponent)
        {
            var view = viewComponent.View;

            ViewPool.ReleaseInstance(view);
            viewComponent.View = null;

            OnViewRecycled(view, entity);
        }
Example #3
0
 protected virtual void OnViewRemoved(IEntity entity, ViewComponent viewComponent) =>
 ViewHandler.DestroyView(viewComponent.View);
Example #4
0
 protected abstract void OnViewCreated(IEntity entity, ViewComponent viewComponent);