/// <summary>
        /// Creates the content to put into the command bar when the node is selected
        /// </summary>
        /// <param name="context">The current presentation context</param>
        public override void CreateCommandContent(ICommandPresentationContext context)
        {
            base.CreateCommandContent(context);
            // This will add an IsActive checkbox to the right rail
            using (context.AddConfigurationPaneContent())
            {
                using (context.AddGroup(ConfigurationItemsGroup))
                {
                    context.Add(IsActiveCommand, CheckBoxFactory.ForConfigurationPane);

                    using (context.AddGroup(SoundSelectionGroupCommand, ListBoxLayoutFactory.ForConfigurationPane))
                    {
                        context.Add(WoofCommand);
                        context.Add(MeowCommand);
                        context.Add(TweetCommand);
                        context.Add(SqueakCommand);
                        context.Add(MooCommand);
                        context.Add(CroakCommand);
                        context.Add(TootCommand);
                        context.Add(QuackCommand);
                        context.Add(BlubCommand);
                        context.Add(OwowowCommand);
                        context.Add(FoxCommand);
                    }
                }
            }
        }
        /// <summary>
        /// Creates the content to put into the command bar when the node is selected
        /// </summary>
        /// <param name="context">The current presentation context</param>
        public override void CreateCommandContent(ICommandPresentationContext context)
        {
            base.CreateCommandContent(context);

            using (context.AddConfigurationPaneContent())
            {
                using (context.AddGroup(ConfigureGroup))
                {
                    context.Add(MultiplierCommand);
                }
            }

            // Create a new ribbon group and add a text block which allows the user to set
            // the multiplier
            //RibbonGroup group = new RibbonGroup() { Command = ConfigureGroup };
            //RibbonTextBox box = new RibbonTextBox();
            //box.Label = "Multiplier";
            //var binding = new Binding("Multiplier");
            //box.SetBinding(RibbonTextBox.TextProperty, binding);
            //box.DataContext = this;
            //group.AddItem(box);

            //// Add the ribbon group to the presentation context
            //context.Add(group);
        }
예제 #3
0
 /// <inheritdoc />
 public override void CreateCommandContentForDocument(ICommandPresentationContext context, Document document)
 {
     base.CreateCommandContentForDocument(context, document);
     using (context.AddDocumentToolBarContent())
     {
         using (context.AddGroup(ShellToolBar.LeftGroupCommand))
         {
             context.Add(RouteCommandsThroughTarget.RouteThroughDesigner(DebuggingCommands.Run, this), ShellToolBarButtonVisualFactory.NoMask);
         }
     }
 }
예제 #4
0
 /// <summary>
 /// This method will create the custom ribbon content to represent the FanSpeed editor
 /// </summary>
 public override void CreateCommandContent(ICommandPresentationContext context)
 {
     base.CreateCommandContent(context);
     using (context.AddConfigurationPaneContent())
     {
         using (context.AddGroup(MocCommonCommands.ControlDesignCommand))
         {
             context.Add(FanCommands.SetFanSpeedCommand);
         }
     }
 }
예제 #5
0
 /// <inheritdoc />
 public override void CreateCommandContent(ICommandPresentationContext context)
 {
     base.CreateCommandContent(context);
     using (context.AddConfigurationPaneContent())
     {
         using (context.AddGroup(WireGroupCommand))
         {
             context.Add(WireBeginsMutableVariableCommand);
         }
     }
 }
예제 #6
0
 /// <inheritdoc />
 public override void CreateCommandContentForSelection(ICommandPresentationContext context)
 {
     base.CreateCommandContentForElement(context);
     using (context.AddConfigurationPaneContent())
     {
         using (context.AddGroup(ConfigurationPaneCommands.VisualStyleGroupCommand))
         {
             context.Add(SelectionCommand);
         }
     }
 }
예제 #7
0
        /// <summary>
        /// Creates the content to put into the command bar when the node is selected
        /// </summary>
        /// <param name="context">The current presentation context</param>
        public override void CreateCommandContent(ICommandPresentationContext context)
        {
            base.CreateCommandContent(context);

            using (context.AddConfigurationPaneContent())
            {
                using (context.AddGroup(ConfigureGroup))
                {
                    context.Add(MultiplierCommand);
                }
            }
        }
예제 #8
0
 /// <inheritdoc />
 public override void CreateCommandContent(ICommandPresentationContext context)
 {
     base.CreateCommandContent(context);
     using (context.AddConfigurationPaneContent())
     {
         using (context.AddGroup(ConfigurationPaneCommands.BehaviorGroupCommand))
         {
             context.Add(LoopTunnelViewModelHelpers.LoopAddBorrowTunnelCommand.SetWeight(0.6));
             context.Add(LoopTunnelViewModelHelpers.LoopAddIterateTunnelCommand.SetWeight(0.6));
         }
     }
 }
예제 #9
0
 /// <inheritdoc />
 public override void CreateCommandContent(ICommandPresentationContext context)
 {
     base.CreateCommandContent(context);
     using (context.AddConfigurationPaneContent())
     {
         using (context.AddGroup(BorrowModeGroupCommand))
         {
             context.Add(BorrowImmutableCommand);
             context.Add(BorrowMutableCommand);
         }
     }
 }
예제 #10
0
 /// <summary>
 /// Creates the content to put into the command bar when the node is selected
 /// </summary>
 /// <param name="context">The current presentation context</param>
 public override void CreateCommandContent(ICommandPresentationContext context)
 {
     base.CreateCommandContent(context);
     // This will add an IsActive checkbox to the right rail
     using (context.AddConfigurationPaneContent())
     {
         using (context.AddGroup(ConfigurationItemsGroup))
         {
             context.Add(IsActiveCommand, CheckBoxFactory.ForConfigurationPane);
         }
     }
 }
예제 #11
0
 /// <inheritdoc />
 public override void CreateCommandContent(ICommandPresentationContext context)
 {
     base.CreateCommandContent(context);
     using (context.AddConfigurationPaneContent())
     {
         using (context.AddGroup(TypeModeGroupCommand))
         {
             context.Add(StructModeCommand);
             context.Add(VariantModeCommand);
         }
     }
 }
예제 #12
0
        /// <inheritdoc />
        protected override void CreateCommandContentForDocument(ICommandPresentationContext context)
        {
            base.CreateCommandContentForDocument(context);

            using (context.AddStudioWindowToolBarContent())
            {
                using (context.AddGroup(ShellToolBar.LeftGroupCommand))
                {
                    context.Add(DocumentCommands.Copy);
                    context.Add(DocumentCommands.Paste);
                }
            }
        }
예제 #13
0
        /// <summary>
        /// Called to create the command content for this document.  This content will be displayed in the "Home"
        /// tab when this document is active
        /// </summary>
        /// <param name="context">The current presentation context</param>
        protected override void CreateCommandContentForDocument(ICommandPresentationContext context)
        {
            base.CreateCommandContentForDocument(context);

            // Add a group with cut, copy, and paste commands
            using (context.AddConfigurationPaneContent())
            {
                using (context.AddGroup(EditingGroupCommand))
                {
                    context.Add(PasteCommand);
                    context.Add(CutCommand);
                    context.Add(CopyCommand);
                }
            }
        }
 /// <summary>
 ///  Creates configuration pane content for this control. See comments on
 ///  <see cref="IProvideCommandContent"/> for more information about correct usage of this function.
 /// </summary>
 /// <param name="context">The current display context</param>
 public override void CreateCommandContent(ICommandPresentationContext context)
 {
     base.CreateCommandContent(context);
     // specify that we are adding things to the configuration pane
     using (context.AddConfigurationPaneContent())
     {
         // First add the group command which lets us know what top level configuration pane group to put the child commands in
         using (context.AddGroup(ConfigurationPaneCommands.BehaviorGroupCommand))
         {
             // add child commands whose visuals will show up in the specified parent group.
             context.Add(FrequencyChannelBrowseCommand);
             context.Add(DutyCycleChannelBrowseCommand);
         }
     }
 }
예제 #15
0
 /// <inheritdoc />
 public override void CreateCommandContent(ICommandPresentationContext context)
 {
     base.CreateCommandContent(context);
     using (context.AddConfigurationPaneContent())
     {
         using (context.AddGroup(ConfigurationPaneCommands.BehaviorGroupCommand))
         {
             context.Add(FlatSequenceTunnelViewModelHelpers.StructureAddBorrowTunnelCommand.SetWeight(0.6));
             if (RebarFeatureToggles.IsCellDataTypeEnabled)
             {
                 context.Add(FlatSequenceTunnelViewModelHelpers.StructureAddLockTunnelCommand.SetWeight(0.6));
             }
             context.Add(FlatSequenceTunnelViewModelHelpers.StructureAddUnwrapOptionTunnelCommand.SetWeight(0.6));
         }
     }
 }
예제 #16
0
        /// <inheritdoc />
        public override void CreateApplicationContent(ICommandPresentationContext context)
        {
            base.CreateApplicationContent(context);

            // Add to the tool launcher
            using (context.AddToolLauncherContent())
            {
                // Add a group
                using (context.AddGroup(CustomToolsWindowGroupCommand))
                {
                    // Add the custom buttons tool window to the group
                    ICommandContentManager commandContentManager = ((CommandContentBuilder)context).Site.CommandContentManager;
                    context.Add(commandContentManager.GetCommandForWindow(CustomButtonsToolWindowType.WindowGuid));
                }
            }
        }
예제 #17
0
 /// <summary>
 /// This is called to add content for an element when it is singularly selected.
 /// </summary>
 /// <param name="context">The current presentation context</param>
 public override void CreateCommandContentForElement(ICommandPresentationContext context)
 {
     if (context.Selection != null && context.Selection.Any() && context.Selection.First().Model != null)
     {
         if (((Element)context.Selection.First().Model).SpecificKind == "NI.LabVIEW.VI:RandomNumber")
         {
             using (context.AddConfigurationPaneContent())
             {
                 using (context.AddGroup(ExampleItemsGroup))
                 {
                     context.Add(MultiplyBy10Command, ButtonFactory.ForConfigurationPane);
                 }
             }
         }
     }
     // Don't forget to call the base
     base.CreateCommandContentForElement(context);
 }
 /// <inheritdoc />
 public override void CreateCommandContentForElement(ICommandPresentationContext context)
 {
     base.CreateCommandContentForElement(context);
     // This entrypoint can be used to add commands for any selectable item in the UI.
     // In this case, we own the ViewModel, so could do it in that class, but are showing
     // here as an example and to keep these commands separate.
     if (context.IsSingleSelect <PulseWidthModulationControlViewModel>())
     {
         using (context.AddConfigurationPaneContent())
         {
             // These are for the individual expandable sections...can make your own or use ours.
             using (context.AddGroup(ConfigurationPaneCommands.BehaviorGroupCommand))
             {
                 // Use a command with a UIType, or use/customize the factory yourself
                 context.Add(CheckBoxCommand);
                 ////context.Add(CheckBoxCommand, CheckBoxFactory.ForConfigurationPane);
                 ////context.Add(CheckBoxCommand, ToggleButtonFactory.ForConfigurationPane);
                 context.Add(TextBoxCommand);
                 var filters = new FileDialogFilterCollection();
                 filters.Add(new FileDialogFilter()
                 {
                     Extensions = new[] { "jpg", "png" }, Label = "Image Files"
                 });
                 context.Add(PathCommand, new PathSelectorFactory()
                 {
                     Filters = filters
                 });
                 ////context.Add(TextBoxCommand, TextBoxFactory.ForConfigurationPane);
                 ////context.Add(TextBoxCommand, StaticTextFactory.ForConfigurationPane);
                 context.Add(NumericCommand, new NumericTextBoxFactory(NITypes.Double));
                 context.Add(ColorCommand, new ColorBoxFactory {
                     ColorOnly = false, ShowMoreColors = true
                 });
                 context.AddContentFontEditor(null, true);
             }
         }
     }
 }