[Inject(true)] //TODO: When propertyInfo.IsOptional tag works for the injector in IL2CPP remove optional inject tag public ViewProcessorMap(IViewProcessorFactory factory, IViewProcessorViewHandler handler = null) { if (handler == null) { handler = new ViewProcessorViewHandler(factory); } _handler = handler; }
/*============================================================================*/ /* Private Functions */ /*============================================================================*/ private void BeforeInitializing() { _viewProcessorMap = _injector.GetInstance(typeof(IViewProcessorMap)) as IViewProcessorMap; _viewProcessorFactory = _injector.GetInstance(typeof(IViewProcessorFactory)) as IViewProcessorFactory; if (_injector.SatisfiesDirectly(typeof(IViewManager))) { _viewManager = _injector.GetInstance(typeof(IViewManager)) as IViewManager; _viewManager.AddViewHandler(_viewProcessorMap as IViewHandler); } }
/*============================================================================*/ /* Constructor */ /*============================================================================*/ public ViewProcessorViewHandler(IViewProcessorFactory factory) { _factory = factory; }