public PinzProjectsTabModel(ITaskRemoteService taskService, ApplicationGlobalModel globalModel, IEventAggregator eventAggregator)
 {
     Log.Debug("Constructor");
     this._taskService     = taskService;
     this._eventAggregator = eventAggregator;
     Projects = new ObservableCollection <ProjectModel>();
 }
        public ProjectAdministrationModel(IAdministrationRemoteService adminService, ApplicationGlobalModel globalModel, [Named("WpfClientMapper")] IMapper mapper,
                                          IEventAggregator eventAggregator)
        {
            this.adminService     = adminService;
            this.globalModel      = globalModel;
            this.mapper           = mapper;
            this._eventAggregator = eventAggregator;

            TabModel = new TabModel()
            {
                Title      = Properties.Resources.AdministrationTab_Title_Project,
                CanClose   = false,
                IsModified = false
            };


            IsProjectSelected = false;

            AllCompanyUsers = new ObservableCollection <User>();
            ProjectUsers    = new ObservableCollection <ProjectUser>();

            AddUserToProjectCommand      = new AwaitableDelegateCommand(AddUserToProject, CanExecuteAddUserToProject);
            RemoveUserFromProjectCommand = new AwaitableDelegateCommand(RemoveUserFromProject, CanExecuteRemoveUserFromProject);
            InviteUserCommand            = new AwaitableDelegateCommand(InviteUser, CanExecuteInviteUser);
            CompanyAdminCheckCommand     = new AwaitableDelegateCommand(CompanyAdminCheck);
            ProjectSetAsAdminCommand     = new AwaitableDelegateCommand(SetAsAdmin, CanSetAsAdmin);
            InitializeCommand            = new AwaitableDelegateCommand(LoadProjects);

            ChangeNotification = new InteractionRequest <INotification>();
        }
Ejemplo n.º 3
0
 public DefaultRibbonController(CustomTaskPane taskPane, TaskFilter filter, IRegionManager regionManager,
                                ApplicationGlobalModel appGlobalModel)
 {
     this._mainTaskPane  = taskPane;
     this._taskFilter    = filter;
     this._regionManager = regionManager;
     this.AppGlobalModel = appGlobalModel;
 }
Ejemplo n.º 4
0
        public ShellModel(ApplicationGlobalModel globalModel, IRegionManager regionManager, TaskFilter filter)
        {
            this.GlobalModel   = globalModel;
            this.RegionManager = regionManager;
            this.Filter        = filter;

            AdminButtonClick = new DelegateCommand <bool?>(OnAdminButtonClick);
        }
        public TaskListModel(ITaskRemoteService service, TaskFilter filter, ApplicationGlobalModel applicationGlobalModel,
                             IEventAggregator eventAggregator, [Named("WpfClientMapper")] IMapper mapper)
        {
            this._service                     = service;
            this._taskFilter                  = filter;
            this._eventAggregator             = eventAggregator;
            this.Tasks                        = new ObservableCollection <Task>();
            CreateTask                        = new AwaitableDelegateCommand(OnCreateTask);
            this._taskFilter.PropertyChanged += Filter_PropertyChanged;
            _currentUser                      = applicationGlobalModel.CurrentUser;
            _mapper = mapper;

            TaskDeletedEvent taskDeletedEvent = eventAggregator.GetEvent <TaskDeletedEvent>();

            taskDeletedEvent.Subscribe(OnDeleteTask, ThreadOption.UIThread, false, t => Category != null && t.CategoryId == Category.CategoryId);
        }
Ejemplo n.º 6
0
        public LoginModel(ApplicationGlobalModel applicationGlobalModel, UserNameClientCredentials userCredentials,
                          IAuthorisationRemoteService authorisationService, IRegionManager regionManager, IEventAggregator eventAggregator)
        {
            this.applicationGlobalModel = applicationGlobalModel;
            this.regionManager          = regionManager;
            this.userCredentials        = userCredentials;
            this.authorisationService   = authorisationService;
            this._eventAggregator       = eventAggregator;

            LoginCommand  = new AwaitableDelegateCommand(Login);
            LoadedCommand = new AwaitableDelegateCommand(Loaded);

            scheduler = TaskScheduler.FromCurrentSynchronizationContext();

            LoadPreviousSettings();
        }
Ejemplo n.º 7
0
        public void SetUpFixture()
        {
            currentUser = new DomainModel.User()
            {
                UserId = Guid.NewGuid(),
                EMail  = "*****@*****.**"
            };

            List <DomainModel.Task> tasks = new List <DomainModel.Task>()
            {
                new DomainModel.Task {
                    TaskId = Guid.NewGuid(), TaskName = "Not started task", Status = TaskStatus.TaskNotStarted, UserId = currentUser.UserId
                },
                new DomainModel.Task {
                    TaskId = Guid.NewGuid(), TaskName = "Task completed", Status = TaskStatus.TaskComplete, DueDate = DateTime.Today, UserId = currentUser.UserId
                },
                new DomainModel.Task {
                    TaskId = Guid.NewGuid(), TaskName = "Task due today", Status = TaskStatus.TaskNotStarted, DueDate = DateTime.Today, UserId = Guid.NewGuid()
                },
                new DomainModel.Task {
                    TaskId = Guid.NewGuid(), TaskName = "In progress task", Status = TaskStatus.TaskInProgress
                }
            };

            taskService = new Mock <ITaskRemoteService>();
            taskService.Setup(x => x.ReadAllTasksByCategoryAsync(It.IsAny <DomainModel.Category>())).Returns(
                System.Threading.Tasks.Task.FromResult(tasks));
            taskFilter          = new TaskFilter();
            taskFilter.Complete = false;
            var applicationGlobalModel = new ApplicationGlobalModel()
            {
                CurrentUser = currentUser
            };

            var eventAgregator  = new Mock <IEventAggregator>();
            var taskDeltedEvent = new Mock <TaskDeletedEvent>();

            eventAgregator.Setup(x => x.GetEvent <TaskDeletedEvent>()).Returns(taskDeltedEvent.Object);

            model = new TaskListModel(taskService.Object, taskFilter, applicationGlobalModel, eventAgregator.Object,
                                      new Mock <IMapper>().Object);
        }
        public CompanyAdministrationModel(IAdministrationRemoteService adminService, IPinzAdminRemoteService pinzAdminService,
                                          ApplicationGlobalModel globalModel, IEventAggregator eventAggregator)
        {
            this._globalModel = globalModel;
            TabModel          = new TabModel
            {
                Title      = Resources.AdministrationTab_Title_Company,
                CanClose   = false,
                IsModified = false
            };
            this._adminService     = adminService;
            this._pinzAdminService = pinzAdminService;
            this._eventAggregator  = eventAggregator;

            StartEditCompany  = new DelegateCommand(OnStartEditCompany, IsCompanyAdmin);
            CancelEditCompany = new DelegateCommand(OnCancelEditCompany, IsCompanyAdmin);
            UpdateCompany     = new AwaitableDelegateCommand(OnUpdateCompany, IsCompanyAdmin);

            NewProject        = new DelegateCommand(OnNewProject, CanCreateNewProject);
            StartEditProject  = new DelegateCommand(OnEditProject, IsCompanyAdmin);
            DeleteProject     = new AwaitableDelegateCommand(OnDeleteProject, IsCompanyAdmin);
            UpdateProject     = new AwaitableDelegateCommand(OnSaveProject, IsCompanyAdmin);
            CancelEditProject = new DelegateCommand(OnCancelEditProject, IsCompanyAdmin);

            StartEditUser  = new DelegateCommand(OnEditUser, IsCompanyAdmin);
            DeleteUser     = new AwaitableDelegateCommand(OnDeleteUser, IsCompanyAdmin);
            UpdateUser     = new AwaitableDelegateCommand(OnUpdateUser, IsCompanyAdmin);
            CancelEditUser = new DelegateCommand(OnCancelEditUser, IsCompanyAdmin);

            Projects = new ObservableCollection <Project>();
            Users    = new ObservableCollection <User>();

            InitializeCommand = new AwaitableDelegateCommand(LoadCompany);

            this.DeleteConfirmation = new InteractionRequest <IConfirmation>();
        }
        public UserSelfAdministrationModel(IAdministrationRemoteService adminService, ApplicationGlobalModel globalModel,
                                           UserNameClientCredentials userCredentials, [Named("WpfClientMapper")]  IMapper mapper, IEventAggregator eventAggregator)
        {
            this._adminService    = adminService;
            this._mapper          = mapper;
            this._userCredentials = userCredentials;
            this._eventAggregator = eventAggregator;

            TabModel = new TabModel()
            {
                Title      = Properties.Resources.AdministrationTab_Title_User,
                CanClose   = false,
                IsModified = false
            };

            CurrentUser = globalModel.CurrentUser;
            BackupUser  = new User();

            IsUserInEditMode     = false;
            IsPasswordInEditMode = false;
            PasswordChangeModel  = new PasswordChangeViewModel();

            StartUserChangesCommand  = new DelegateCommand(StartUserChanges);
            SaveUserChangesCommand   = new AwaitableDelegateCommand(SaveUserChanges);
            CancelUserChangesCommand = new DelegateCommand(CancelUserChanges);

            StartPasswordChangeCommand  = new DelegateCommand(StartPasswordChange);
            ChangeUserPasswordCommand   = new AwaitableDelegateCommand(ChangeUserPassword);
            CancelPasswordChangeCommand = new DelegateCommand(CancelPasswordChange);

            ChangeNotification = new InteractionRequest <INotification>();
        }