示例#1
0
        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);
            }
        }
示例#2
0
        /// <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);
                }
            }
        }