Initial integration.

This commit is contained in:
Burak Kaan Köse
2025-12-26 20:46:48 +01:00
parent 10b85ea135
commit 014b5aa671
79 changed files with 4694 additions and 432 deletions
@@ -30,6 +30,18 @@ public class CalendarItem : ICalendarItem
public TimeSpan StartDateOffset { get; set; }
public TimeSpan EndDateOffset { get; set; }
/// <summary>
/// IANA timezone identifier for the start time (e.g., "America/New_York", "Europe/London").
/// If null or empty, UTC is assumed.
/// </summary>
public string StartTimeZone { get; set; }
/// <summary>
/// IANA timezone identifier for the end time (e.g., "America/New_York", "Europe/London").
/// If null or empty, UTC is assumed.
/// </summary>
public string EndTimeZone { get; set; }
private ITimePeriod _period;
public ITimePeriod Period
{
@@ -170,10 +182,70 @@ public class CalendarItem : ICalendarItem
HtmlLink = HtmlLink,
StartDateOffset = StartDateOffset,
EndDateOffset = EndDateOffset,
StartTimeZone = StartTimeZone,
EndTimeZone = EndTimeZone,
RemoteEventId = RemoteEventId,
IsHidden = IsHidden,
IsLocked = IsLocked,
IsOccurrence = true
};
}
/// <summary>
/// Gets the start date as a DateTimeOffset with the correct timezone.
/// If StartTimeZone is available, uses it to calculate the offset.
/// Otherwise, uses the stored StartDateOffset or assumes UTC.
/// </summary>
[Ignore]
public DateTimeOffset StartDateTimeOffset
{
get
{
if (!string.IsNullOrEmpty(StartTimeZone))
{
try
{
var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(StartTimeZone);
var offset = timeZoneInfo.GetUtcOffset(StartDate);
return new DateTimeOffset(StartDate, offset);
}
catch
{
// If timezone lookup fails, fall back to stored offset
}
}
// Fall back to stored offset, or UTC if offset is zero
return new DateTimeOffset(StartDate, StartDateOffset);
}
}
/// <summary>
/// Gets the end date as a DateTimeOffset with the correct timezone.
/// If EndTimeZone is available, uses it to calculate the offset.
/// Otherwise, uses the stored EndDateOffset or assumes UTC.
/// </summary>
[Ignore]
public DateTimeOffset EndDateTimeOffset
{
get
{
if (!string.IsNullOrEmpty(EndTimeZone))
{
try
{
var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(EndTimeZone);
var offset = timeZoneInfo.GetUtcOffset(EndDate);
return new DateTimeOffset(EndDate, offset);
}
catch
{
// If timezone lookup fails, fall back to stored offset
}
}
// Fall back to stored offset, or UTC if offset is zero
return new DateTimeOffset(EndDate, EndDateOffset);
}
}
}
@@ -3,5 +3,6 @@
public enum NavigationReferenceFrame
{
ShellFrame,
InnerShellFrame,
RenderingFrame
}
@@ -0,0 +1,7 @@
namespace Wino.Core.Domain.Enums;
public enum WinoApplicationMode
{
Mail,
Calendar
}
@@ -64,6 +64,12 @@ public interface ISynchronizationManager
Task<MailSynchronizationResult> SynchronizeProfileAsync(Guid accountId,
CancellationToken cancellationToken = default);
/// <summary>
/// Handles calendar synchronization for the given account.
/// </summary>
Task<CalendarSynchronizationResult> SynchronizeCalendarAsync(CalendarSynchronizationOptions options,
CancellationToken cancellationToken = default);
/// <summary>
/// Downloads a MIME message for the given mail item.
/// </summary>
@@ -8,9 +8,10 @@ public interface INavigationService
{
bool Navigate(WinoPage page,
object parameter = null,
NavigationReferenceFrame frame = NavigationReferenceFrame.ShellFrame,
NavigationReferenceFrame frame = NavigationReferenceFrame.InnerShellFrame,
NavigationTransitionType transition = NavigationTransitionType.None);
Type GetPageType(WinoPage winoPage);
void GoBack();
bool ChangeApplicationMode(WinoApplicationMode mode);
}