private void HeaderRadioButton_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         RadioButton button = sender as RadioButton;
         if (button.Checked)
         {
             Disconnect(Mode);
             object dataSource = null;
             if (ShownItems.TryGetValue(button, out dataSource))
             {
                 UpdateMode();
                 ConnectCurrent();
                 ShowDataSource(dataSource);
             }
             else
             {
                 ShowEmpty();
             }
         }
         else
         {
             ShowEmpty();
         }
     }
     catch (Exception exception)
     {
         ShowOverlayError(exception);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Add items to the list
        /// </summary>
        public void ShowItems(DaSubscription anDaSubscription, DaItem[] items, ShownItems cond, DaSession[] sessions)
        {
            try
            {
                this.SuspendLayout();
                itemsListView.Items.Clear();
                switch (cond)
                {
                case ShownItems.All:
                    ShowAllItems(sessions);
                    break;

                case ShownItems.Session:
                    ShowSessionItems(sessions);
                    break;

                case ShownItems.Subscription:
                    ShowSubscriptionItems(anDaSubscription, items);
                    break;
                }
                if (itemsListView.Items.Count > 0)
                {
                    this.Enabled = true;
                }
                else
                {
                    this.Enabled = false;
                }
                this.ResumeLayout();
            }
            catch { }
        }