public AddQuickEventViewModel(IGoogleCalendar googleCalendar, IRepository commonRepository, IMessanger commonMessanger) { try { log.Debug("Loading AddQuickEvent view model..."); calendar = googleCalendar; repository = commonRepository; messanger = commonMessanger; quickEventsTemplates = repository.GetQuickEventsTemplates(); LoadData(); SelectTemplateCommand = new RelayCommand(SelectTemplate); MoveUpTemplateCommand = new RelayCommand(MoveUpTemplate); MoveDownTemplateCommand = new RelayCommand(MoveDownTemplate); RemoveTemplateCommand = new RelayCommand(RemoveTemplate); AddQuickEventCommand = new RelayCommand(AddQuickEvent); SaveAsTemplateCommand = new RelayCommand(SaveAsTemplate); log.Debug("AddQuickEvent view model was succssfully loaded"); } catch (Exception ex) { log.Error("Failed to load AddQuickEvent view model:", ex); } }
public EventsCreateViewModel(IGoogleCalendar googleCalendar, IRecurrenceSettings recurrenceSettings, IRepository commonRepository, IMessanger commonMessanger) { try { log.Debug("Loading EventsCreate view model..."); calendar = googleCalendar; repository = commonRepository; messanger = commonMessanger; recurrence = recurrenceSettings; CreateEventCommand = new RelayCommand(CreateEvent); UpdateEventCommand = new RelayCommand(UpdateEvent); QuickActionCommand = new RelayCommand(QuickAction); CancelUpdateEventCommand = new RelayCommand(CancelUpdateEvent); // For Update Events eventUpdater = repository.GetEventUpdater(); if (eventUpdater.Type != GoogleCalendar.ActionType.none) { IsUpdate = true; SetUpdateEventSettings(eventUpdater); } log.Debug("EventsCreate view model was succssfully loaded"); } catch(Exception ex) { log.Error("Failed to load EventsCreate view model:", ex); } }
public CalendarEventList GetEventsMultipleCalendars(IGoogleCalendar calendar, DateTime start, DateTime end, UserCalendarsPreferences preferences) { CalendarEventList selectedEvents = new CalendarEventList(); var userCalendars = preferences.UserCalendars; foreach (var userCalendar in userCalendars) { CalendarEventList events = new CalendarEventList(); if (userCalendar.IsVisible == true) { calendar.SetCalendar(userCalendar.Id); events = GetEvents(calendar, start, end); calendar.SetCalendar(DEFAULT_CALENDAR); } // Mark events from not default calendar as fake if (userCalendar.IsPrimary == false) { foreach (var ev in events) { ev.IsFake = true; } } selectedEvents.AddRange(events); } selectedEvents = AddEmptyDaysFakeEvents(selectedEvents, start, end, preferences); return(selectedEvents); }
public AddQuickEventViewModel(IGoogleCalendar googleCalendar, IRepository commonRepository, IMessanger commonMessanger) { try { log.Debug("Loading AddQuickEvent view model..."); calendar = googleCalendar; repository = commonRepository; messanger = commonMessanger; quickEventsTemplates = repository.GetQuickEventsTemplates(); LoadData(); SelectTemplateCommand = new RelayCommand(SelectTemplate); MoveUpTemplateCommand = new RelayCommand(MoveUpTemplate); MoveDownTemplateCommand = new RelayCommand(MoveDownTemplate); RemoveTemplateCommand = new RelayCommand(RemoveTemplate); AddQuickEventCommand = new RelayCommand(AddQuickEvent); SaveAsTemplateCommand = new RelayCommand(SaveAsTemplate); log.Debug("AddQuickEvent view model was succssfully loaded"); } catch (Exception ex) { log.Error("Failed to load AddQuickEvent view model:", ex); } }
public EventsCreateViewModel(IGoogleCalendar googleCalendar, IRecurrenceSettings recurrenceSettings, IRepository commonRepository, IMessanger commonMessanger) { try { log.Debug("Loading EventsCreate view model..."); calendar = googleCalendar; repository = commonRepository; messanger = commonMessanger; recurrence = recurrenceSettings; CreateEventCommand = new RelayCommand(CreateEvent); UpdateEventCommand = new RelayCommand(UpdateEvent); QuickActionCommand = new RelayCommand(QuickAction); CancelUpdateEventCommand = new RelayCommand(CancelUpdateEvent); // For Update Events eventUpdater = repository.GetEventUpdater(); if (eventUpdater.Type != GoogleCalendar.ActionType.none) { IsUpdate = true; SetUpdateEventSettings(eventUpdater); } log.Debug("EventsCreate view model was succssfully loaded"); } catch (Exception ex) { log.Error("Failed to load EventsCreate view model:", ex); } }
public StudentGroupsController(IStudentGroupsRepository studentGroupsRepository, IStudentGroupScheduleProvider scheduleProvider, IGoogleCalendar googleCalendar, IDataStore dataStore, IPlanerConfig planerConfig) { _studentGroupsRepository = studentGroupsRepository; _scheduleProvider = scheduleProvider; _googleCalendar = googleCalendar; _dataStore = dataStore; _planerConfig = planerConfig; }
public UpdateEventOptionsViewModel(IGoogleCalendar googleCalendar, IRepository commonRepository) { calendar = googleCalendar; repository = commonRepository; selectedEvent = repository.GetCurrentEvent(); UpdateOnlyInstanceCommand = new RelayCommand(UpdateOnlyInstance); UpdateFollowingEventsCommand = new RelayCommand(UpdateFollowingEvents); UpdateAllEventsCommand = new RelayCommand(UpdateAllEvents); CancelUpdateCommand = new RelayCommand(CancelUpdate); }
public DeleteEventOptionsViewModel(IGoogleCalendar googleCalendar, IRepository commonRepository, IMessanger commonMessanger) { calendar = googleCalendar; repository = commonRepository; selectedEvent = repository.GetCurrentEvent(); messanger = commonMessanger; DeleteOnlyInstanceCommand = new RelayCommand(DeleteOnlyInstance); DeleteFollowingEventsCommand = new RelayCommand(DeleteFollowingEvents); DeleteAllEventsCommand = new RelayCommand(DeleteAllEvents); CancelDeleteCommand = new RelayCommand(CloseWindow); }
public UpdateEventOptionsViewModel(IGoogleCalendar googleCalendar, IRepository commonRepository) { calendar = googleCalendar; repository = commonRepository; selectedEvent = repository.GetCurrentEvent(); UpdateOnlyInstanceCommand = new RelayCommand(UpdateOnlyInstance); UpdateFollowingEventsCommand = new RelayCommand(UpdateFollowingEvents); UpdateAllEventsCommand = new RelayCommand(UpdateAllEvents); CancelUpdateCommand = new RelayCommand(CancelUpdate); }
public DeleteEventOptionsViewModel(IGoogleCalendar googleCalendar, IRepository commonRepository, IMessanger commonMessanger) { calendar = googleCalendar; repository = commonRepository; selectedEvent = repository.GetCurrentEvent(); messanger = commonMessanger; DeleteOnlyInstanceCommand = new RelayCommand(DeleteOnlyInstance); DeleteFollowingEventsCommand = new RelayCommand(DeleteFollowingEvents); DeleteAllEventsCommand = new RelayCommand(DeleteAllEvents); CancelDeleteCommand = new RelayCommand(CloseWindow); }
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); } }
public OthersCalendarViewModel(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; OthersEvents = service.GetOthersEvents(calendar, period.Today(), _OtherCalendarsList); OthersEvents = service.FormatEventsDatesStringRepresentation(OthersEvents, repository.GetDateTimePreferences()); GetOtherCalendarsCommand = new RelayCommand(GetOtherCalendars); 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); } }
public CalendarEventList GetEvents(IGoogleCalendar calendar, DateTime start, DateTime end) { log.Debug("Select events, period=" + start + " - " + end); CalendarEventList selectedEvents = new CalendarEventList(); foreach (CalendarEvent ev in calendar.GetEvents(start, end)) { try { if (MatchStartDate(ev.Start, start) && MatchEndDate(ev.End, end)) { selectedEvents.Add(ev); } } catch (Exception ex) { log.Error("Failed to get events for a specified period", ex); log.Info("Event info: " + ev.ToString()); } } log.Debug("Successfully selected events for a specified period"); return(selectedEvents); }
public CalendarEventList GetOthersEvents(IGoogleCalendar calendar, DateTime start, DateTime end , String CalendarIDs) { log.Debug("Select events, period=" + start + " - " + end); CalendarEventList selectedEvents = new CalendarEventList(); foreach (CalendarEvent ev in calendar.GetOthersEvents(start, end, CalendarIDs)) { try { if (MatchStartDate(ev.Start, start) && MatchEndDate(ev.End, end)) { selectedEvents.Add(ev); } } catch (Exception ex) { log.Error("Failed to get events for a specified period", ex); log.Info("Event info: " + ev.ToString()); } } log.Debug("Successfully selected events for a specified period"); return selectedEvents; }
public CalendarEventList GetEvents(IGoogleCalendar calendar, TimeIntervals period) { return GetEvents(calendar, period.Start, period.End); }
public CalendarEventList GetOthersEvents(IGoogleCalendar calendar, TimeIntervals period, String CalendarIDs) { return(GetOthersEvents(calendar, period.Start, period.End, CalendarIDs)); }
public CalendarEventList GetEventsMultipleCalendars(IGoogleCalendar calendar, TimeIntervals period, UserCalendarsPreferences preferences) { return(GetEventsMultipleCalendars(calendar, period.Start, period.End, preferences)); }
public CalendarEventList GetEvents(IGoogleCalendar calendar, TimeIntervals period) { return(GetEvents(calendar, period.Start, period.End)); }
public CalendarEventList GetComparingEvents(IGoogleCalendar calendar, TimeIntervals period, List <String> CalendarIDs, String ViewFormat, bool primary) { return(GetComparingEvents(calendar, period.Start, period.End, CalendarIDs, ViewFormat, primary)); }
public CalendarEventList GetOthersEvents(IGoogleCalendar calendar, TimeIntervals period , String CalendarIDs) { return GetOthersEvents(calendar, period.Start, period.End, CalendarIDs); }
public CalendarEventList GetComparingEvents(IGoogleCalendar calendar, TimeIntervals period, List<String> CalendarIDs, String ViewFormat,bool primary) { return GetComparingEvents(calendar, period.Start, period.End, CalendarIDs, ViewFormat,primary); }