Displaying events and all-day events.
This commit is contained in:
29
Wino.Core.Domain/Collections/CalendarEventCollection.cs
Normal file
29
Wino.Core.Domain/Collections/CalendarEventCollection.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Core.Domain.Collections
|
||||
{
|
||||
public class CalendarEventCollection : ObservableRangeCollection<ICalendarItem>
|
||||
{
|
||||
public ObservableCollection<ICalendarItem> AllDayEvents { get; } = new ObservableCollection<ICalendarItem>();
|
||||
public new void Add(ICalendarItem calendarItem)
|
||||
{
|
||||
base.Add(calendarItem);
|
||||
|
||||
if (calendarItem.Period.Duration.TotalMinutes == 1440)
|
||||
{
|
||||
AllDayEvents.Add(calendarItem);
|
||||
}
|
||||
}
|
||||
|
||||
public new void Remove(ICalendarItem calendarItem)
|
||||
{
|
||||
base.Remove(calendarItem);
|
||||
|
||||
if (calendarItem.Period.Duration.TotalMinutes == 1440)
|
||||
{
|
||||
AllDayEvents.Remove(calendarItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@
|
||||
public const string WinoLocalDraftHeader = "X-Wino-Draft-Id";
|
||||
public const string LocalDraftStartPrefix = "localDraft_";
|
||||
|
||||
public const string CalendarEventRecurrenceRuleSeperator = "___";
|
||||
|
||||
public const string ToastMailUniqueIdKey = nameof(ToastMailUniqueIdKey);
|
||||
public const string ToastActionKey = nameof(ToastActionKey);
|
||||
|
||||
|
||||
@@ -14,5 +14,6 @@ namespace Wino.Core.Domain.Interfaces
|
||||
Task InsertAccountCalendarAsync(AccountCalendar accountCalendar);
|
||||
Task UpdateAccountCalendarAsync(AccountCalendar accountCalendar);
|
||||
Task CreateNewCalendarItemAsync(CalendarItem calendarItem, List<CalendarEventAttendee> attendees);
|
||||
Task<List<ICalendarItem>> GetCalendarEventsAsync(Guid calendarId, DateTime rangeStart, DateTime rangeEnd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using Itenso.TimePeriod;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Collections;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Calendar
|
||||
{
|
||||
@@ -12,7 +11,7 @@ namespace Wino.Core.Domain.Models.Calendar
|
||||
public class CalendarDayModel
|
||||
{
|
||||
public TimeRange Period { get; }
|
||||
public ObservableCollection<ICalendarItem> Events { get; } = new ObservableCollection<ICalendarItem>();
|
||||
public CalendarEventCollection EventsCollection { get; } = new CalendarEventCollection();
|
||||
public CalendarDayModel(DateTime representingDate, CalendarRenderOptions calendarRenderOptions)
|
||||
{
|
||||
RepresentingDate = representingDate;
|
||||
|
||||
Reference in New Issue
Block a user