public RibbonControl(IHtmlEditorComponentContext componentContext, IHtmlEditorCommandSource commandSource) { // Note that this code is *not* called within Mail. // Shared canvas commands/code need to go in ContentEditor. this.componentContext = componentContext; this.commandSource = commandSource; componentContext.CommandManager.BeginUpdate(); componentContext.CommandManager.Add(CommandId.FileMenu, null); componentContext.CommandManager.Add(CommandId.HomeTab, null); componentContext.CommandManager.Add(new GroupCommand(CommandId.ClipboardGroup, componentContext.CommandManager.Get(CommandId.Paste))); componentContext.CommandManager.Add(new GroupCommand(CommandId.PublishGroup, componentContext.CommandManager.Get(CommandId.PostAndPublish))); componentContext.CommandManager.Add(new Command(CommandId.ParagraphGroup)); // Has it's own icon componentContext.CommandManager.Add(new GroupCommand(CommandId.InsertGroup, componentContext.CommandManager.Get(CommandId.InsertPictureFromFile))); componentContext.CommandManager.Add(CommandId.InsertTab, null); componentContext.CommandManager.Add(new GroupCommand(CommandId.BreaksGroup, componentContext.CommandManager.Get(CommandId.InsertHorizontalLine))); componentContext.CommandManager.Add(new GroupCommand(CommandId.TablesGroup, componentContext.CommandManager.Get(CommandId.InsertTable))); componentContext.CommandManager.Add(new GroupCommand(CommandId.MediaGroup, componentContext.CommandManager.Get(CommandId.InsertPictureFromFile))); componentContext.CommandManager.Add(new GroupCommand(CommandId.PluginsGroup, componentContext.CommandManager.Get(CommandId.PluginsGallery))); componentContext.CommandManager.Add(new Command(CommandId.BlogProviderTab)); componentContext.CommandManager.Add(new GroupCommand(CommandId.BlogProviderBlogGroup, componentContext.CommandManager.Get(CommandId.ConfigureWeblog))); componentContext.CommandManager.Add(new GroupCommand(CommandId.BlogProviderThemeGroup, componentContext.CommandManager.Get(CommandId.UpdateWeblogStyle))); componentContext.CommandManager.Add(CommandId.PreviewTab, null); // Already added PublishGroup componentContext.CommandManager.Add(new GroupCommand(CommandId.BrowserGroup, componentContext.CommandManager.Get(CommandId.UpdateWeblogStyle))); // Already added TextEditingGroup componentContext.CommandManager.Add(new GroupCommand(CommandId.PreviewGroup, componentContext.CommandManager.Get(CommandId.ClosePreview))); componentContext.CommandManager.Add(CommandId.DebugTab, null); componentContext.CommandManager.Add(new Command(CommandId.GeneralDebugGroup)); componentContext.CommandManager.Add(new Command(CommandId.DialogDebugGroup)); componentContext.CommandManager.Add(new Command(CommandId.TextDebugGroup)); componentContext.CommandManager.Add(new Command(CommandId.ValidateDebugGroup)); componentContext.CommandManager.Add(new Command(CommandId.FormatMapGroup)); componentContext.CommandManager.Add(new Command(CommandId.FormatMapPropertiesGroup)); componentContext.CommandManager.EndUpdate(); }
public HtmlStylePicker(IHtmlEditorCommandSource commandSource) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); styleComboBox.AccessibleName = Res.Get(StringId.TextStyle); this.AccessibleName = Res.Get(StringId.TextStyle); this.AccessibleRole = System.Windows.Forms.AccessibleRole.ComboBox; _commandSource = commandSource; this.toolTip.SetToolTip(this.styleComboBox, Res.Get(StringId.ChangeTextStyle)); this.SetStyles(defaultStyles); using (new AutoGrow(this, AnchorStyles.Right, true)) DisplayHelper.AutoFitSystemCombo(styleComboBox, 0, int.MaxValue, false); }