Пример #1
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();
            }
        }
Пример #2
0
 public void EnableOrDisable(AstroCalendar another)
 {
     this.Enabled = (another.EventsCollection != null);
 }