private void PostSharedEvents() { DateTime _Now = Now(); if (PostTime <= _Now) { PostTime = _Now + TimeSpan.FromHours(12); Settings.SetString("SharedCalendarPost", PostTime.ToString(CultureInfo.InvariantCulture)); using ShareCalendarWindow Dlg = new ShareCalendarWindow(Settings); Dlg.PostSharedEvents(MushroomInfoList); } }
/// <summary> /// Handles the shared calendar event. /// </summary> public void OnSharedCalendar() { using ShareCalendarWindow Dlg = new ShareCalendarWindow(Settings); bool?Result = Dlg.ShowDialog(); if (Result.HasValue && Result.Value) { if (Dlg.IsEventActive) { if (PostTime == DateTime.MaxValue) { PostTime = Now(); Settings.SetString("SharedCalendarPost", PostTime.ToString(CultureInfo.InvariantCulture)); } PostSharedEvents(); } else { PostTime = DateTime.MaxValue; Settings.SetString("SharedCalendarPost", string.Empty); } } }