예제 #1
0
        public void CustomRefresh()
        {
            this.Refresh();

            if (SelectedItem != null)
            {
                OpacityChangeBtn.Enabled = true;
                OpacityChangeBtn.Value   = SelectedItem.GetOpacity();
                deleteBtn.Enabled        = true;
                if (SelectedItem.GetType().Name != "GroupOfItems")
                {
                    copyBtn.Enabled = true;
                }
                nameTextBox.Enabled = true;
                nameTextBox.Text    = SelectedItem.Name;
            }
            else
            {
                OpacityChangeBtn.Enabled = false;
                OpacityChangeBtn.Value   = 0;
                deleteBtn.Enabled        = false;
                copyBtn.Enabled          = false;
                nameTextBox.Enabled      = false;
                nameTextBox.Text         = String.Empty;
            }

            if (this.Items.Count > 0)
            {
                findItemBtn.Enabled = true;
            }
            else
            {
                findItemBtn.Enabled = false;
            }

            if (this.copied != null)
            {
                pasteBtn.Enabled = true;
            }
            else
            {
                pasteBtn.Enabled = false;
            }

            if (this.groupOfItems != null && SelectedItem != null && this.SelectedItem.GetType().Name == "GroupOfItems")
            {
                breakBtn.Enabled = true;
                groupBtn.Enabled = false;
                copyBtn.Enabled  = false;
            }
            else
            {
                if (this.Items.Count > 1 && this.groupOfItems == null)
                {
                    groupBtn.Enabled = true;
                }
                else
                {
                    groupBtn.Enabled = false;
                }
                breakBtn.Enabled = false;
            }
        }