public void OnValidationError(VerifierResultCollection validationErrors) { if (validationErrors.HasErrors) { EventFns.Publish(new ValidationErrorMessage(validationErrors)); } }
public void ShoudForwardMessage() { var handler = new TestEventHandler(); EventFns.Forward(handler, "Hello"); Assert.IsTrue(handler.StringHandled, "Message should have been handled"); }
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(); }
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 }
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); }
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; }
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)); }
public void ShouldBePolymorphicMessageHandler() { var handler = new TestEventHandler(); Assert.IsTrue(EventFns.IsHandler(handler, typeof(TestMessage)), "Should be a message handler"); }
public void ShouldBeMessageHandler() { var handler = new TestEventHandler(); Assert.IsTrue(EventFns.IsHandler(handler, typeof(string)), "Should be a message handler"); }
protected MessageProcessor() { EventFns.Subscribe(this); }