/// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();

            this.menuDefinitionEntryCommandRecentPost = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components);
            this.menuDefinitionEntryCommandGlossary = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components);
            //
            // menuDefinitionEntryCommandRecentPost
            //
            this.menuDefinitionEntryCommandRecentPost.CommandIdentifier = "OpenLiveWriter.PostEditor.OpenPost.CommandRecentPost";
            this.menuDefinitionEntryCommandRecentPost.SeparatorAfter = false;
            this.menuDefinitionEntryCommandRecentPost.SeparatorBefore = false;
            //
            // menuDefinitionEntryCommandGlossary
            //
            this.menuDefinitionEntryCommandGlossary.CommandIdentifier = "OpenLiveWriter.HtmlEditor.Linking.Commands.CommandGlossary";
            this.menuDefinitionEntryCommandGlossary.SeparatorAfter = false;
            this.menuDefinitionEntryCommandGlossary.SeparatorBefore = false;
            //
            // LinkingContextMenuDefinition
            //
            this.Entries.AddRange(new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntry[] {
                                                                                                        this.menuDefinitionEntryCommandRecentPost,
                                                                                                    	this.menuDefinitionEntryCommandGlossary});
        }
 public int Add(CommandId commandIdentifier, bool separatorBefore, bool separatorAfter)
 {
     MenuDefinitionEntryCommand mde = new MenuDefinitionEntryCommand();
     mde.CommandIdentifier = commandIdentifier.ToString();
     mde.SeparatorBefore = separatorBefore;
     mde.SeparatorAfter = separatorAfter;
     return Add(mde);
 }
        public int Add(CommandId commandIdentifier, bool separatorBefore, bool separatorAfter)
        {
            MenuDefinitionEntryCommand mde = new MenuDefinitionEntryCommand();

            mde.CommandIdentifier = commandIdentifier.ToString();
            mde.SeparatorBefore   = separatorBefore;
            mde.SeparatorAfter    = separatorAfter;
            return(Add(mde));
        }
        /// <summary>
        /// Use strongly typed overload instead of this if possible!!
        /// </summary>
        public void Add(string commandIdentifier, bool separatorBefore, bool separatorAfter)
        {
            MenuDefinitionEntryCommand mde = new MenuDefinitionEntryCommand();

            mde.CommandIdentifier = commandIdentifier;
            mde.SeparatorBefore   = separatorBefore;
            mde.SeparatorAfter    = separatorAfter;
            Add(mde);
        }
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.menuDefinitionEntryCommandCut = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components);
            this.menuDefinitionEntryCommandCopy = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components);
            this.menuDefinitionEntryCommandPaste = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components);
            this.menuDefinitionEntryCommandPasteSpecial = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components);
            this.menuDefinitionEntryCommandSelectAll = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components);
            this.menuDefinitionEntryCommandInsertLink = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components);
            //
            // menuDefinitionEntryCommandCut
            //
            this.menuDefinitionEntryCommandCut.CommandIdentifier = "MindShare.ApplicationCore.Commands.Cut";
            this.menuDefinitionEntryCommandCut.SeparatorAfter = false;
            this.menuDefinitionEntryCommandCut.SeparatorBefore = false;
            //
            // menuDefinitionEntryCommandCopy
            //
            this.menuDefinitionEntryCommandCopy.CommandIdentifier = "MindShare.ApplicationCore.Commands.Copy";
            this.menuDefinitionEntryCommandCopy.SeparatorAfter = false;
            this.menuDefinitionEntryCommandCopy.SeparatorBefore = false;
            //
            // menuDefinitionEntryCommandPaste
            //
            this.menuDefinitionEntryCommandPaste.CommandIdentifier = "MindShare.ApplicationCore.Commands.Paste";
            this.menuDefinitionEntryCommandPaste.SeparatorAfter = false;
            this.menuDefinitionEntryCommandPaste.SeparatorBefore = false;
            //
            // menuDefinitionEntryCommandPasteSpecial
            //
            this.menuDefinitionEntryCommandPasteSpecial.CommandIdentifier = "MindShare.ApplicationCore.Commands.PasteSpecial";
            this.menuDefinitionEntryCommandPasteSpecial.SeparatorAfter = false;
            this.menuDefinitionEntryCommandPasteSpecial.SeparatorBefore = false;
            //
            // menuDefinitionEntryCommandSelectAll
            //
            this.menuDefinitionEntryCommandSelectAll.CommandIdentifier = "MindShare.ApplicationCore.Commands.SelectAll";
            this.menuDefinitionEntryCommandSelectAll.SeparatorAfter = true;
            this.menuDefinitionEntryCommandSelectAll.SeparatorBefore = true;
            //
            // menuDefinitionEntryCommandInsertLink
            //
            this.menuDefinitionEntryCommandInsertLink.CommandIdentifier = "OpenLiveWriter.ApplicationFramework.Commands.InsertLink";
            this.menuDefinitionEntryCommandInsertLink.SeparatorAfter = true;
            this.menuDefinitionEntryCommandInsertLink.SeparatorBefore = true;

            this.Entries.AddRange(new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntry[] {
                                                                                                        this.menuDefinitionEntryCommandCut,
                                                                                                        this.menuDefinitionEntryCommandCopy,
                                                                                                        this.menuDefinitionEntryCommandPaste,
                                                                                                        this.menuDefinitionEntryCommandPasteSpecial,
                                                                                                        this.menuDefinitionEntryCommandSelectAll,
                                                                                                        this.menuDefinitionEntryCommandInsertLink});

        }
        private void InitializeCommands()
        {
            commandContextManager = new CommandContextManager(_decoratorsManager.CommandManager);
            commandContextManager.BeginUpdate();

            commandAddMenu = new Command(CommandId.AddDecorator);
            _decoratorsManager.CommandManager.Add(commandAddMenu);
            addCommandContextMenuDefinition = new CommandContextMenuDefinition(components);
            if (_decoratorsManager != null)
            {
                for (int i = 0; i < _decoratorsManager.ImageDecoratorGroups.Length; i++)
                {
                    ImageDecoratorGroup imageDecoratorGroup = _decoratorsManager.ImageDecoratorGroups[i];

                    foreach (ImageDecorator imageDecorator in imageDecoratorGroup.ImageDecorators)
                    {
                        if (!imageDecorator.IsHidden) //don't show hidden decorators in the command list
                        {
                            Command ImageDecoratorApplyCommand = imageDecorator.Command;
                            MenuDefinitionEntryCommand imageDecoratorMenuEntry = new MenuDefinitionEntryCommand(components);
                            imageDecoratorMenuEntry.CommandIdentifier = ImageDecoratorApplyCommand.Identifier;
                            addCommandContextMenuDefinition.Entries.Add(imageDecoratorMenuEntry);

                            ImageDecoratorApplyCommand.Execute += new EventHandler(imageDecoratorApplyCommand_Execute);
                            ImageDecoratorApplyCommand.Tag = imageDecorator.Id;
                        }
                    }
                }
            }

            commandImageRemove = new Command(CommandId.RemoveDecorator);
            commandImageRemove.Execute += new EventHandler(commandRemoveMenu_Execute);
            commandContextManager.AddCommand(commandImageRemove, CommandContext.Normal);

            _decoratorsManager.CommandManager.SuppressEvents = true;
            try
            {
                commandContextManager.EndUpdate();
            }
            finally
            {
                _decoratorsManager.CommandManager.SuppressEvents = true;
            }
        }