Example #1
0
        private void AddEventTagMenuItem_Click(object sender, RoutedEventArgs e)
        {
            if (!File.Exists(recordJSDirectory) || !File.Exists(recordXMLDirectory))
            {
                //TODO: update this error message.
                MessageBox.Show("Cannot upload Event without recording files. Please open an existing recording or make a new one.", AppName, MessageBoxButton.OK, MessageBoxImage.Error);
            }
            AddEventWindow addEventWindow = new AddEventWindow();

            addEventWindow.ShowDialog();
        }
Example #2
0
 public AddEventViewModel(AddEventWindow ThisWindow)
 {
     AddCommand = new RelayCommand(o =>
     {
         ThisWindow.Close();
     });
     AddContactCommand = new RelayCommand(o =>
     {
         new ContactListWindow().ShowDialog();
     });
 }
        private void btnAddEvent_Click(object sender, RoutedEventArgs e)
        {
            viewModel.ResetNewEvent();
            EventWindow.Visibility = Visibility.Collapsed;
            if (AddEventWindow.Visibility != Visibility.Visible)
            {
                AddEventWindow.Resize();
            }

            EditButton.Visibility = Visibility.Collapsed;
            SaveButton.Visibility = Visibility.Visible;
        }
 private void btnEdit_Click(object sender, RoutedEventArgs e)
 {
     AddEventWindow.Resize();
 }
Example #5
0
        public MainViewModel(MonthControlViewModel MonthVM, User authorisedUser)
        {
            MonthVM        = new MonthControlViewModel(authorisedUser);
            YearVM         = new YearControlViewModel();
            CurrentView    = MonthVM;
            AuthorisedUser = authorisedUser;

            UserName = AuthorisedUser.Name;
            Img      = AuthorisedUser.Img;

            MonthViewCommand = new RelayCommand(o =>
            {
                CurrentView = MonthVM;
            });
            YearViewCommand = new RelayCommand(o =>
            {
                CurrentView = YearVM;
            });
            AddTaskCommand = new RelayCommand(o =>
            {
                AddTaskWindow taskWin = new AddTaskWindow()
                {
                    DataContext = new AddTaskViewModel(_authorisedauser, MonthVM)
                };
                taskWin.ShowDialog();
            });
            AddEventCommand = new RelayCommand(o =>
            {
                AddEventWindow taskWin = new AddEventWindow()
                {
                    DataContext = new AddEventViewModel(_authorisedauser, MonthVM)
                };
                taskWin.ShowDialog();
            });
            AddContactCommand = new RelayCommand(o =>
            {
                AddContactWindow taskWin = new AddContactWindow()
                {
                    DataContext = new AddContactViewModel(_authorisedauser)
                };
                taskWin.ShowDialog();
            });
            RegistrationCommand = new RelayCommand(o =>
            {
                UserWindow taskWin = new UserWindow()
                {
                    DataContext = new UserViewModel(AuthorisedUser, this)
                };
                taskWin.ShowDialog();
            });

            Registry registry = new Registry();

            registry.Schedule(() =>
            {
                foreach (Event _event in UnitOfWorkSingleton.Instance.Events.List)
                {
                    TimeSpan?diffresult = _event.StartTime - DateTime.Now;
                    if (diffresult <= TimeSpan.FromMinutes(60))
                    {
                        MessageBox.Show("Час до начала события: " + _event.Name);
                    }
                }
            }).ToRunNow().AndEvery(20).Minutes();
            JobManager.Initialize(registry);
        }
        public void ShowAddEvent()
        {
            AddEventWindow addEventWindow = new AddEventWindow();

            addEventWindow.ShowDialog();
        }