Пример #1
0
        public MainWindow(IEventValidator eventValidator, MainWindowViewModel viewModel)
        {
            _eventValidator = eventValidator;
            _viewModel      = viewModel;

            InitializeComponent();
        }
Пример #2
0
        public MainWindow(IEventValidator eventValidator, MainWindowViewModel viewModel, ITileProviderFactory tileProviderFactory)
        {
            _eventValidator      = eventValidator;
            _viewModel           = viewModel;
            _tileProviderFactory = tileProviderFactory;

            InitializeComponent();
        }
Пример #3
0
 public EventService(IEventRepository eventRepository,
                     IDateEventUtil dateEventUtil,
                     IPrintEvent printEvent,
                     IEventValidator eventValidator)
 {
     _eventRepository = eventRepository;
     _dateEventUtil   = dateEventUtil;
     _printEvent      = printEvent;
     _eventValidator  = eventValidator;
 }
        public static void Validate(this DynamicEvent @event, IEventValidator validator)
        {
            if (String.IsNullOrWhiteSpace(@event.EventType))
            {
                return;
            }

            var type = EventTypeCache.GetType(@event.EventType);

            if (type == null)
            {
                throw new IgnoredEventException();
            }

            var item = EventDescriptorExtensions.ForceConvertToStrongEventType(@event.EventType, @event, ValidationSerializerSettings.Instance);

            validator.DynamicInvokeValidate(type, item);
        }
Пример #5
0
        public HealthMonitor(IEventProvider eventProvider, IEventValidator eventValidator, IPoolManager poolManager)
        {
            if (eventProvider == null)
            {
                throw new ArgumentNullException("eventProvider");
            }

            if (eventValidator == null)
            {
                throw new ArgumentNullException("eventValidator");
            }

            if (poolManager == null)
            {
                throw new ArgumentNullException("poolManager");
            }

            this.eventProvider = eventProvider;
            this.eventProvider.OnEntryWritten += this.OnEntryWritten;
            this.eventValidator = eventValidator;
            this.poolManager = poolManager;
        }
Пример #6
0
        public HealthMonitor(IEventProvider eventProvider, IEventValidator eventValidator, IPoolManager poolManager)
        {
            if (eventProvider == null)
            {
                throw new ArgumentNullException("eventProvider");
            }

            if (eventValidator == null)
            {
                throw new ArgumentNullException("eventValidator");
            }

            if (poolManager == null)
            {
                throw new ArgumentNullException("poolManager");
            }

            this.eventProvider = eventProvider;
            this.eventProvider.OnEntryWritten += this.OnEntryWritten;
            this.eventValidator = eventValidator;
            this.poolManager    = poolManager;
        }
Пример #7
0
 public LambdaEventHandler(IEventValidator <T> eventValidator, ILogger logger, Action <T> eventHandlerAction)
     : base(eventValidator, logger)
 {
     _eventHandlerAction = eventHandlerAction;
 }
Пример #8
0
 public static IEventTrigger Validated(this IEventValidator validator, IEventTrigger act) => new ConditionalEventListener(act, CombinedCondition(validator, act));
 public void SetUp()
 {
     this.EventValidator = new EventValidator(this.Container.Resolve<ISettings>());
 }
Пример #10
0
 public ValidatedCallOnce(IEventValidator validator, System.Action act) : this(validator.CurrentValidationCheck, act)
 {
 }
 public PriceBandEventHandler(IDatabaseCommands dbCommands, IEventValidator validator, IMessagingLogger messagingLogger, IConfiguration configuration) : base(dbCommands, validator, messagingLogger)
 {
     _logger        = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
     _configuration = configuration;
 }
 public AccountUpdateFailedEventHandler(IDatabaseCommands dbCommands, IEventValidator validator, IMessagingLogger messagingLogger, ILog errorLogger) : base(dbCommands, validator, messagingLogger)
 {
     _logger = errorLogger;
 }
Пример #13
0
 public EventHandler(IEventValidator <T> eventValidator,
                     ILogger logger)
 {
     _eventValidator = eventValidator;
     _logger         = logger;
 }
Пример #14
0
 protected override void Establish_context()
 {
     _sut = new EventValidator(Create.New.StubbedEventPluginConfiguration().Build());
 }
Пример #15
0
 public static void Synchronize <T>(this IValueStateObserver <T> source, IValueStateSetter <T> valueState, IEventValidator validation) where T : struct
 {
     Synchronize <T>(source, valueState.Setter, validation);
 }
Пример #16
0
 public static void Synchronize <T>(this IValueStateObserver <T> state, System.Action evnt, IEventValidator validation) where T : struct
 {
     Synchronize(state, validation.Validated(evnt));
 }
Пример #17
0
 public static void Synchronize <T>(this IValueStateObserver <T> state, IEventTrigger <T> evnt, IEventValidator validation) where T : struct
 {
     Synchronize <T>(state, validation.Validated <T>(evnt));
 }
 protected ListenerEventHandler(IDatabaseCommands dbCommands, IEventValidator validator, IMessagingLogger messagingLogger)
 {
     DbCommands      = dbCommands;
     Validator       = validator;
     MessagingLogger = messagingLogger;
 }
Пример #19
0
    public static void BlockOn(this ISemaphoreInterection semaphore, IBoolStateObserver source, IEventValidator eventValidation)
    {
        Action releaseAction = () => semaphore.Release(source);

        source.RegisterOnTrue(new ConditionalEventListener(() => semaphore.Block(source), eventValidation.CurrentValidationCheck));
        source.RegisterOnFalse(new ConditionalEventListener(releaseAction, eventValidation.CurrentValidationCheck));

        eventValidation.OnVoid.Register(new CallOnce(releaseAction));
    }
Пример #20
0
 public static IEventTrigger Validated(this IEventValidator validator, Action act, UnityEngine.Transform transform) => new ConditionalEventListener(act, CombinedCondition(validator, transform));
Пример #21
0
    static Func <bool> CombinedCondition(IEventValidator validator, IValidatedObject obj)
    {
        var boxedValidation = validator.CurrentValidationCheck;

        return(() => { return obj.IsValid && boxedValidation(); });
    }
Пример #22
0
 public static IEventTrigger Validated(this IEventValidator validator, Action act, System.Func <bool> AdditionalCheck) => new ConditionalEventListener(act, CombinedCondition(validator, AdditionalCheck));
Пример #23
0
    static Func <bool> CombinedCondition(IEventValidator validator, System.Func <bool> AdditionalCheck)
    {
        var boxedValidation = validator.CurrentValidationCheck;

        return(() => { return AdditionalCheck() && boxedValidation(); });
    }
 public PriceBandEventHandler(IDatabaseCommands dbCommands, IEventValidator validator, IMessagingLogger messagingLogger, IConfiguration configuration, ILog errorLogger) : base(dbCommands, validator, messagingLogger)
 {
     _logger        = errorLogger;
     _configuration = configuration;
 }
 public void SetUp()
 {
     this.EventValidator = new EventValidator(this.Container.Resolve <ISettings>());
 }
 public AccountUpdateFailedEventHandler(IDatabaseCommands dbCommands, IEventValidator validator, IMessagingLogger messagingLogger) : base(dbCommands, validator, messagingLogger)
 {
     _logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
 }
Пример #27
0
 public static IEventTrigger <T, K, J> Validated <T, K, J>(this IEventValidator validator, Action <T, K, J> act) => new ConditionalEventListener <T, K, J>(act, validator.CurrentValidationCheck);
 public FileUploadCompletedHandler(IDatabaseCommands dbCommands, IEventValidator validator, IMessagingLogger messagingLogger) : base(dbCommands, validator, messagingLogger)
 {
     _logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
 }
Пример #29
0
 public static IEventTrigger <T, K, J> Validated <T, K, J>(this IEventValidator validator, IEventTrigger <T, K, J> act) => new ConditionalEventListener <T, K, J>(act, CombinedCondition(validator, act));
Пример #30
0
 public ValidatedCallOnce(IEventValidator validator, IEventTrigger callback) : this(validator.CurrentValidationCheck, callback)
 {
 }
Пример #31
0
 public static IEventTrigger Validated(this IEventValidator validator, Action act) => new ConditionalEventListener(act, validator.CurrentValidationCheck);
Пример #32
0
    static Func <bool> CombinedCondition(IEventValidator validator, UnityEngine.Transform transform)
    {
        var boxedValidation = validator.CurrentValidationCheck;

        return(() => { return transform != null && boxedValidation(); });
    }
		protected override void Establish_context()
		{
			_sut = new EventValidator(Create.New.StubbedEventPluginConfiguration().Build());
		}