Пример #1
0
 private void GetTodayEvents()
 {
     Events = service.GetEvents(calendar, period.Today());
     Events = service.FormatEventsDatesStringRepresentation(Events, repository.GetDateTimePreferences());
     SortAndFilterEvents();
     eventListType = EventsListType.Today;
     ShowResults();
 }
Пример #2
0
 public SettingsViewModel(IRepository commonRepository, IMessanger commonMessanger)
 {
     repository = commonRepository;            
     dateTimePreferences = repository.GetDateTimePreferences();
     messanger = commonMessanger;
     LoadDateTimePreferences();            
     SaveDateTimePreferencesCommand = new RelayCommand(SaveDateTimePreferences);
 }
Пример #3
0
 public SettingsViewModel(IRepository commonRepository, IMessanger commonMessanger)
 {
     repository          = commonRepository;
     dateTimePreferences = repository.GetDateTimePreferences();
     messanger           = commonMessanger;
     LoadDateTimePreferences();
     SaveDateTimePreferencesCommand = new RelayCommand(SaveDateTimePreferences);
 }
Пример #4
0
        public EventsListViewModel(IGoogleCalendar googleCalendar, ICalendarEventService eventService, ITimeIntervals timeInterval, IRepository commonRepository, IMessanger commonMessanger)
        {
            try
            {
                log.Debug("Loading EventsList view model...");

                calendar                = googleCalendar;
                service                 = eventService;
                period                  = timeInterval;
                repository              = commonRepository;
                sortFilterPreferences   = repository.GetSortFilterPreferences();
                userCalendarPreferences = repository.GetUserCalendarsPreferences();
                messanger               = commonMessanger;
                UpdateUserCalendarPreferences();

                Events = service.GetEventsMultipleCalendars(calendar, period.Today(), userCalendarPreferences);
                Events = service.FormatEventsDatesStringRepresentation(Events, repository.GetDateTimePreferences());

                GetTodayEventsCommand                    = new RelayCommand(GetTodayEvents);
                GetTomorrowEventsCommand                 = new RelayCommand(GetTomorrowEvents);
                GetThisWeekEventsCommand                 = new RelayCommand(GetThisWeekEvents);
                GetNextWeekEventsCommand                 = new RelayCommand(GetNextWeekEvents);
                GetThisMonthEventsCommand                = new RelayCommand(GetThisMonthEvents);
                GetNextMonthEventsCommand                = new RelayCommand(GetNextMonthEvents);
                GetPeriodEventsCommand                   = new RelayCommand(GetPeriodEvents);
                RefreshCommand                           = new RelayCommand(RefreshEventsList);
                DeleteEventCommand                       = new RelayCommand(DeleteEvent);
                UpdateEventCommand                       = new RelayCommand(FullUpdateEvent);
                ConfirmEventCommand                      = new RelayCommand(ConfirmEvent);
                MakeTentativeEventCommand                = new RelayCommand(MakeTentativeEvent);
                ShowChooseDateEventsControlsCommand      = new RelayCommand(ShowChooseDateEventsControls);
                HideChooseDateEventsControlsCommand      = new RelayCommand(HideChooseDateEventsControls);
                GetChooseDateEventsCommand               = new RelayCommand(GetChooseDateEvents);
                SetSortingAndFilteringPreferencesCommand = new RelayCommand(SetSortingAndFilteringPreferences);
                SetCalendarCommand                       = new RelayCommand(SetCalendar);
                LogOutCommand = new RelayCommand(LogOut);

                log.Debug("EventsList view model was succssfully loaded");
            }
            catch (Exception ex)
            {
                log.Error("Failed to load EventsList view model:", ex);
            }
        }
Пример #5
0
        public EventsListViewModel(IGoogleCalendar googleCalendar, ICalendarEventService eventService, ITimeIntervals timeInterval, IRepository commonRepository, IMessanger commonMessanger)
        {
            try
            {
                log.Debug("Loading EventsList view model...");

                calendar = googleCalendar;
                service = eventService;
                period = timeInterval;
                repository = commonRepository;
                sortFilterPreferences = repository.GetSortFilterPreferences();
                messanger = commonMessanger;

                Events = service.GetEvents(calendar, period.Today());
                Events = service.FormatEventsDatesStringRepresentation(Events, repository.GetDateTimePreferences());

                GetTodayEventsCommand = new RelayCommand(GetTodayEvents);
                GetTomorrowEventsCommand = new RelayCommand(GetTomorrowEvents);
                GetThisWeekEventsCommand = new RelayCommand(GetThisWeekEvents);
                GetNextWeekEventsCommand = new RelayCommand(GetNextWeekEvents);
                GetThisMonthEventsCommand = new RelayCommand(GetThisMonthEvents);
                GetNextMonthEventsCommand = new RelayCommand(GetNextMonthEvents);
                GetPeriodEventsCommand = new RelayCommand(GetPeriodEvents);
                RefreshCommand = new RelayCommand(RefreshEventsList);
                DeleteEventCommand = new RelayCommand(DeleteEvent);
                UpdateEventCommand = new RelayCommand(FullUpdateEvent);
                ConfirmEventCommand = new RelayCommand(ConfirmEvent);
                MakeTentativeEventCommand = new RelayCommand(MakeTentativeEvent);
                ShowChooseDateEventsControlsCommand = new RelayCommand(ShowChooseDateEventsControls);
                HideChooseDateEventsControlsCommand = new RelayCommand(HideChooseDateEventsControls);
                GetChooseDateEventsCommand = new RelayCommand(GetChooseDateEvents);
                SetSortingAndFilteringPreferencesCommand = new RelayCommand(SetSortingAndFilteringPreferences);
                LogOutCommand = new RelayCommand(LogOut);

                log.Debug("EventsList view model was succssfully loaded");
            }
            catch(Exception ex)
            {
                log.Error("Failed to load EventsList view model:", ex);
            }
        }
Пример #6
0
        private void GetOtherCalendars()
        {
            //Regex emailFormat = new Regex(@"[\w-]+@([\w-]+\.)+[\w-]+");

            //if (!string.IsNullOrEmpty(mailAddress) && mailIDPattern.IsMatch(mailAddress))

            //String listOfEmails = _OtherCalendarsList;
            //List<String> emailList = _OtherCalendarsList.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();

            // int i = 0;
            // foreach (String str in emailList)
            // {
            //    Console.WriteLine("First"+ i+ str);
            //  i++;
            //  Console.WriteLine("sssssssssss" + OthersEvents.ToString());
            OthersEvents = service.GetOthersEvents(calendar, period.Today(), _OtherCalendarsList);
            OthersEvents = service.FormatEventsDatesStringRepresentation(OthersEvents, repository.GetDateTimePreferences());
            SortAndFilterEvents();
            eventListType = EventsListType.Today;
            // OthersEvents = service.GetOthersEvents(calendar, period.Today(), emailList[1]);
            //OthersEvents = service.FormatEventsDatesStringRepresentation(OthersEvents, repository.GetDateTimePreferences());
            //SortAndFilterEvents();
            //eventListType = EventsListType.Today;
            ShowResults();
            //}
        }
Пример #7
0
        private void GetComparingCalendars()
        {
            //Regex emailFormat = new Regex(@"[\w-]+@([\w-]+\.)+[\w-]+");

            //if (!string.IsNullOrEmpty(mailAddress) && mailIDPattern.IsMatch(mailAddress))
            if (_ComparingCalendarsList != null)
            {
                List <String> emailList = convertEmailStringToList(_ComparingCalendarsList);
                ComparingEvents = service.GetComparingEvents(calendar, period.Today(), emailList, _SelectedviewFormat, _primaryEmail);
                ComparingEvents = service.FormatEventsDatesStringRepresentation(ComparingEvents, repository.GetDateTimePreferences());
                SortAndFilterEvents();
                eventListType = EventsListType.Today;
                ShowResults();
            }
            //}
        }