mirror of
https://github.com/vrcx-team/VRCX.git
synced 2026-04-06 00:32:02 +02:00
Calendar local datetime format and download buttons
This commit is contained in:
@@ -221,5 +221,28 @@ namespace VRCX
|
||||
{
|
||||
MainForm.Instance.BeginInvoke(new MethodInvoker(() => { MainForm.Instance.SetTrayIconNotification(notify); }));
|
||||
}
|
||||
|
||||
public override void OpenCalendarFile(string icsContent)
|
||||
{
|
||||
// validate content
|
||||
if (!icsContent.StartsWith("BEGIN:VCALENDAR") ||
|
||||
!icsContent.EndsWith("END:VCALENDAR"))
|
||||
throw new Exception("Invalid calendar file");
|
||||
|
||||
try
|
||||
{
|
||||
var tempPath = Path.Combine(Program.AppDataDirectory, "event.ics");
|
||||
File.WriteAllText(tempPath, icsContent);
|
||||
Process.Start(new ProcessStartInfo
|
||||
{
|
||||
FileName = tempPath,
|
||||
UseShellExecute = true
|
||||
})?.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error(ex, "Failed to open calendar file");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@ namespace VRCX
|
||||
public abstract void CopyImageToClipboard(string path);
|
||||
public abstract void FlashWindow();
|
||||
public abstract void SetUserAgent();
|
||||
public abstract void OpenCalendarFile(string icsContent);
|
||||
|
||||
// Folders
|
||||
public abstract string GetVRChatAppDataLocation();
|
||||
|
||||
@@ -147,5 +147,9 @@ namespace VRCX
|
||||
public override void SetTrayIconNotification(bool notify)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenCalendarFile(string icsContent)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user