Example #1
0
        private void dateTimePicker_Leave(object sender, EventArgs e)
        {
            DateTimeOffset newDate = dateTimePicker.Value.Date;

            if (EventsCollection == null || newDate != RefTime.Date)
            {
                RefTime = new DateTimeOffset(newDate.Year, newDate.Month, newDate.Day, 0, 0, 0, TimeSpan.Zero);

                EventsCollection = new EventsSummary(RefTime, Kind, Concerned);

                displayEvents();

                if (PeriodEventsCollectedEvent != null)
                {
                    PeriodEventsCollectedEvent(this);
                }
            }
        }
Example #2
0
        public void SynchPeriodParameters(AstroCalendar another)
        {
            if (another == this)
            {
                return;
            }

            List <string> valueStrings = new List <string>();

            if (this.Kind != another.Kind)
            {
                this.Kind = another.Kind;

                dateTimePicker.CustomFormat = EventsSummary.DateTimeFormats[Kind];

                foreach (object item in comboBoxPeriodType.Items)
                {
                    valueStrings.Add(item.ToString());
                }

                comboBoxPeriodType.SelectedIndex = valueStrings.IndexOf(Kind.ToString());

                EventsCollection = null;

                treeViewEvents.Nodes.Clear();
            }
            else if (this.Concerned != another.Concerned)
            {
                this.Concerned = another.Concerned;

                valueStrings.Clear();

                foreach (object item in comboBoxImportance.Items)
                {
                    valueStrings.Add(item.ToString());
                }

                comboBoxImportance.SelectedIndex = valueStrings.IndexOf(Concerned.ToString());

                EventsCollection = null;

                treeViewEvents.Nodes.Clear();
            }
        }