public EntitySignals(IHandlersResolver resolver = null)
        {
            var handlersResolver = resolver ?? new CachedHandlersResolver(new AttributeHandlersResolver());

            _global = new GlobalStorage(handlersResolver);
            _entity = new DynamicStorage(handlersResolver);
        }
        public void DynamicEntityStorage()
        {
            var handler = new MockHandlerResolver(new[] {
                new HandlerMeta(typeof(TestEntity), typeof(int), 2,
                                EfficientInvoker.ForMethod(typeof(TestReceiver), "HandleSignal"))
            });
            var es     = new DynamicStorage(handler);
            var entity = new TestEntity();

            RunMeasure(() => {
                var receiver = new TestReceiver();
                es.On <TestEntity>().Add(receiver);
                es.On(entity).Send(1);
                es.On <TestEntity>().Remove(receiver);
            });
        }
Exemple #3
0
 public DynamicTypeContext(IHandlersResolver resolver, DynamicStorage storage) : base(resolver)
 {
     _storage = storage;
 }
 public DynamicEntityContext(IHandlersResolver resolver, DynamicStorage dynamicStorage,
                             TEntity entity = default) : base(resolver, dynamicStorage, entity)
 {
 }