Exemple #1
0
 private void ButtonOptionGroupChanging(object sender, OptionGroupChangingEventArgs e)
 {
     if (e.NewChecked.Name == "helpPanel")
     {
         advPropertyGrid1.HelpType = ePropertyGridHelpType.Panel;
     }
     else
     {
         advPropertyGrid1.HelpType = ePropertyGridHelpType.SuperTooltip;
     }
 }
Exemple #2
0
        /// <summary>
        /// Raises OptionGroupChanging event.
        /// </summary>
        /// <param name="e">Provides event arguments.</param>
        protected virtual void OnOptionGroupChanging(OptionGroupChangingEventArgs e)
        {
            OptionGroupChangingEventHandler handler = OptionGroupChanging;
            if (handler != null)
                handler(this, e);

            if (!e.Cancel)
            {
                IOwnerItemEvents owner = this.GetIOwnerItemEvents();
                if (owner != null)
                    owner.InvokeOptionGroupChanging(this, e);
            }
        }
Exemple #3
0
        /// <summary>
        /// Called when Checked property has changed.
        /// </summary>
        /// <param name="oldValue">Old property value</param>
        /// <param name="newValue">New property value</param>
        protected virtual void OnCheckedChanged(bool oldValue, bool newValue)
        {
            // Allow user to cancel the checking
            if (newValue && _OptionGroup.Length > 0 && this.Parent != null)
            {
                MetroTileItem b = null;
                foreach (BaseItem item in this.Parent.SubItems)
                {
                    if (item == this)
                        continue;
                    b = item as MetroTileItem;
                    if (b != null && b.OptionGroup == _OptionGroup && b.Checked)
                    {
                        break;
                    }
                }
                OptionGroupChangingEventArgs e = new OptionGroupChangingEventArgs(b, this);
                OnOptionGroupChanging(e);
                if (e.Cancel)
                {
                    _Checked = oldValue;
                    return;
                }
            }

            if (ShouldSyncProperties)
                BarFunctions.SyncProperty(this, "Checked");

            if (_OptionGroup != "" && newValue && this.Parent != null)
            {
                foreach (BaseItem item in this.Parent.SubItems)
                {
                    if (item == this)
                        continue;
                    MetroTileItem b = item as MetroTileItem;
                    if (b != null && b.OptionGroup == _OptionGroup && b.Checked)
                        b.Checked = false;
                }
            }

            //OnPropertyChanged(new PropertyChangedEventArgs("Checked"));
            this.Refresh();
            OnCheckedChanged(EventArgs.Empty);
        }
 private void itemPanel1_OptionGroupChanging(object sender, OptionGroupChangingEventArgs e)
 {
     BaseItem parent = e.NewChecked.Parent;
     tabControl1.SelectedTabIndex = parent.SubItems.IndexOf(e.NewChecked);
 }