Пример #1
0
        private void ActionItem_PropertyChanged(ActionItem item, PropertyChangedEventArgs e)
        {
            var guiItem = this.GetItem(item.Key);

            switch (e.PropertyName)
            {
            case "Caption":
                guiItem.Text = item.Caption;
                break;

            case "Enabled":
                guiItem.Enabled = item.Enabled;
                break;

            case "Visible":
                guiItem.Visible = item.Visible;
                break;

            case "ToolTipText":
                guiItem.ToolTipText = item.ToolTipText;
                break;

            case "GroupCaption":
                // todo: change group
                break;

            case "RootKey":
                // todo: change root
                // note, this case will also be selected in the case that we set the Root key in our code.
                break;

            case "Key":
            default:
                throw new NotSupportedException(" This Header Control implementation doesn't have an implemenation for or has banned modifying that property.");
            }
        }
Пример #2
0
 /// <summary>
 /// Make sure the root key is present or use a default.
 /// </summary>
 /// <param name="item">
 /// </param>
 private void EnsureNonNullRoot(ActionItem item)
 {
     if (item.RootKey == null)
     {
         EnsureExtensionsTabExists();
         item.RootKey = ExtensionsRootKey;
     }
 }
Пример #3
0
        private void ActionItem_PropertyChanged(ActionItem item, PropertyChangedEventArgs e)
        {
            var guiItem = GetItem(item.Key);

            switch (e.PropertyName)
            {
                case "Caption":
                    guiItem.Text = item.Caption;
                    break;

                case "Enabled":
                    guiItem.Enabled = item.Enabled;
                    break;

                case "Visible":
                    guiItem.Visible = item.Visible;
                    break;

                case "ToolTipText":
                    guiItem.ToolTipText = item.ToolTipText;
                    break;

                case "GroupCaption":
                    break;

                case "RootKey":
                    // note, this case will also be selected in the case that we set the Root key in our code.
                    break;

                default:
                    throw new NotSupportedException("This Header Control implementation doesn't have an implemenation for or has banned modifying that property.");
            }
        }
Пример #4
0
        private void ActionItem_PropertyChanged(ActionItem item, PropertyChangedEventArgs e)
        {
            if (item.GetType().Equals(typeof(SimpleActionItem)) || item.GetType().Equals(typeof(RootItem)))
            {
                MenuItem guiItem = GetMenuItem(item.Key);

                switch (e.PropertyName)
                {
                    case "Caption":
                        guiItem.Text = item.Caption;
                        break;

                    case "Enabled":
                        guiItem.Enabled = item.Enabled;
                        break;

                    case "Visible":
                        guiItem.Visible = item.Visible;
                        break;

                    case "ToolTipText":
                        //guiItem.ToolTipText = item.ToolTipText;
                        break;

                    case "GroupCaption":
                        // todo: change group
                        break;

                    case "RootKey":
                        // todo: change root
                        // note, this case will also be selected in the case that we set the Root key in our code.
                        break;

                    case "Key":
                    default:
                        throw new NotSupportedException(" This Header Control implementation doesn't have an implemenation for or has banned modifying that property.");
                }
            }
            else
            {
                Control guiItem = GetItem(item.Key);

                switch (e.PropertyName)
                {
                    case "Caption":
                        guiItem.Text = item.Caption;
                        break;

                    case "Enabled":
                        guiItem.Enabled = item.Enabled;
                        break;

                    case "Visible":
                        guiItem.Visible = item.Visible;
                        break;

                    case "ToolTipText":
                        //guiItem.ToolTipText = item.ToolTipText;
                        break;

                    case "GroupCaption":
                        // todo: change group
                        break;

                    case "RootKey":
                        // todo: change root
                        // note, this case will also be selected in the case that we set the Root key in our code.
                        break;

                    case "Key":
                    default:
                        throw new NotSupportedException(" This Header Control implementation doesn't have an implemenation for or has banned modifying that property.");
                }
            }
        }