Пример #1
0
 public void OnValidationError(VerifierResultCollection validationErrors)
 {
     if (validationErrors.HasErrors)
     {
         EventFns.Publish(new ValidationErrorMessage(validationErrors));
     }
 }
Пример #2
0
        public void ShoudForwardMessage()
        {
            var handler = new TestEventHandler();

            EventFns.Forward(handler, "Hello");
            Assert.IsTrue(handler.StringHandled, "Message should have been handled");
        }
Пример #3
0
 public override void OnSaved(TempHireEntities source, EntitySavedEventArgs args)
 {
     if (args.CompletedSuccessfully)
     {
         EventFns.Publish(new SavedMessage(args.Entities));
     }
 }
        public StaffingResourceSearchViewModel(IUnitOfWorkManager <IResourceMgtUnitOfWork> unitOfWorkManager)
        {
            EventFns.Subscribe(this);

            _unitOfWorkManager = unitOfWorkManager;
            Busy = new BusyWatcher();
        }
Пример #5
0
        public void ShouldForwardPolymorphicMessage()
        {
            var handler = new TestEventHandler();
            var message = new TestMessage();

            EventFns.Forward(handler, message);
            Assert.IsTrue(handler.IMessageHandled, "Message should have been handled");
        }
        public StaffingResourceSkillsViewModel(IUnitOfWorkManager <IResourceMgtUnitOfWork> unitOfWorkManager)
            : base(unitOfWorkManager)
        {
            EventFns.Subscribe(this);

            // ReSharper disable DoNotCallOverridableMethodsInConstructor
            DisplayName = "Skills";
            // ReSharper restore DoNotCallOverridableMethodsInConstructor
        }
Пример #7
0
        public ShellViewModel([ImportMany] IEnumerable <IWorkspace> workspaces, IToolbarManager toolbar,
                              IAuthenticationService authenticationService, ExportFactory <LoginViewModel> loginFactory)
        {
            EventFns.Subscribe(this);

            Toolbar                = toolbar;
            _workspaces            = workspaces;
            _authenticationService = authenticationService;
            _loginFactory          = loginFactory;
            _navigator             = new Navigator(this);
        }
Пример #8
0
        public ResourceMgtViewModel(StaffingResourceSearchViewModel searchPane,
                                    ExportFactory <StaffingResourceNameEditorViewModel> nameEditorFactory,
                                    IDialogManager dialogManager, IToolbarManager toolbar)
        {
            EventFns.Subscribe(this);

            SearchPane         = searchPane;
            _nameEditorFactory = nameEditorFactory;
            _dialogManager     = dialogManager;
            _toolbar           = toolbar;
            _navigator         = new Navigator(this);

            PropertyChanged += OnPropertyChanged;

            _selectionChangeTimer = new DispatcherTimer {
                Interval = new TimeSpan(0, 0, 0, 0, 200)
            };
            _selectionChangeTimer.Tick += OnSelectionChangeElapsed;
        }
Пример #9
0
 public override void OnEntityChanged(TempHireEntities source, EntityChangedEventArgs args)
 {
     EventFns.Publish(new EntityChangedMessage(args.Entity));
 }
 protected override void OnLoggedOut()
 {
     base.OnLoggedOut();
     EventFns.Publish(new LoggedOutMessage());
 }
 protected override void OnLoggedIn()
 {
     base.OnLoggedIn();
     EventFns.Publish(new LoggedInMessage(CurrentUser));
 }
Пример #12
0
        public void ShouldBePolymorphicMessageHandler()
        {
            var handler = new TestEventHandler();

            Assert.IsTrue(EventFns.IsHandler(handler, typeof(TestMessage)), "Should be a message handler");
        }
Пример #13
0
        public void ShouldBeMessageHandler()
        {
            var handler = new TestEventHandler();

            Assert.IsTrue(EventFns.IsHandler(handler, typeof(string)), "Should be a message handler");
        }
Пример #14
0
 protected MessageProcessor()
 {
     EventFns.Subscribe(this);
 }