protected override void InitializeCommands() { CommandManager.BeginUpdate(); base.InitializeCommands(); CommandManager.Add(CommandId.UpdateWeblogStyle, commandUpdateWeblogStyle_Execute); commandViewUseStyles = CommandManager.Add(CommandId.ViewUseStyles, commandViewUseStyles_Execute); commandSemanticHtml = new SemanticHtmlGalleryCommand(CommandId.SemanticHtmlGallery, _postEditingSite, GetPreviewHtml, CommandManager, _currentEditor as IHtmlEditorComponentContext); commandSemanticHtml.ExecuteWithArgs += new ExecuteEventHandler(commandSemanticHtml_ExecuteWithArgs); commandSemanticHtml.ComponentContext = () => _currentEditor as IHtmlEditorComponentContext; CommandManager.Add(commandSemanticHtml); commandInsertablePlugins = new InsertablePluginsGalleryCommand(); commandInsertablePlugins.ExecuteWithArgs += new ExecuteEventHandler(commandInsertablePlugins_ExecuteWithArgs); commandInsertablePlugins.LoadItems(); CommandManager.Add(commandInsertablePlugins); commandInsertWebImage = new Command(CommandId.WebImage); commandInsertWebImage.Execute += new EventHandler(commandInsertWebImage_Execute); CommandManager.Add(commandInsertWebImage); commandInsertExtendedEntry = CommandManager.Add(CommandId.InsertExtendedEntry, commandInsertExtendedEntry_Execute); EditorLoaded += new EventHandler(ContentEditor_EditorHtmlReloaded); // QAT CommandManager.Add(new GalleryCommand <CommandId>(CommandId.QAT)); // Outspace CommandManager.Add(new RecentItemsCommand(_postEditingSite)); CommandManager.Add(new GroupCommand(CommandId.InsertImageSplit, CommandManager.Get(CommandId.InsertPictureFromFile))); // WinLive 181138 - A targetted fix to ensure the InsertVideoSplit command is disabled if we don't support InsertVideo (e.g zh-CN doesn't support video) // The problem is related to Windows 7 #712524 & #758433 and this is a work around for this particular case. // The dropdown commands for this (InsertVideoFromFile etc) are already disabled based on the feature support. We explicitly set the state of // group command here so that it has the right state to begin with (otherwise a switch tab/app is required to refresh). GroupCommand commandInsertVideoSplit = new GroupCommand(CommandId.InsertVideoSplit, CommandManager.Get(CommandId.InsertVideoFromFile)); commandInsertVideoSplit.Enabled = MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.VideoProviders); CommandManager.Add(commandInsertVideoSplit); foreach (CommandId commandId in new CommandId[] { CommandId.SplitNew, CommandId.SplitSave, CommandId.SplitPrint, CommandId.PasteSplit, CommandId.FormatTablePropertiesSplit }) { CommandManager.Add(new Command(commandId)); } _commandClosePreview = CommandManager.Add(CommandId.ClosePreview, commandClosePreview_Execute, false); CommandManager.EndUpdate(); }
protected override void InitializeCommands() { CommandManager.BeginUpdate(); base.InitializeCommands(); CommandManager.Add(CommandId.UpdateWeblogStyle, commandUpdateWeblogStyle_Execute); commandViewUseStyles = CommandManager.Add(CommandId.ViewUseStyles, commandViewUseStyles_Execute); commandSemanticHtml = new SemanticHtmlGalleryCommand(CommandId.SemanticHtmlGallery, _postEditingSite, GetPreviewHtml, CommandManager, _currentEditor as IHtmlEditorComponentContext); commandSemanticHtml.ExecuteWithArgs += new ExecuteEventHandler(commandSemanticHtml_ExecuteWithArgs); commandSemanticHtml.ComponentContext = () => _currentEditor as IHtmlEditorComponentContext; CommandManager.Add(commandSemanticHtml); commandInsertablePlugins = new InsertablePluginsGalleryCommand(); commandInsertablePlugins.ExecuteWithArgs += new ExecuteEventHandler(commandInsertablePlugins_ExecuteWithArgs); commandInsertablePlugins.LoadItems(); CommandManager.Add(commandInsertablePlugins); commandInsertWebImage = new Command(CommandId.WebImage); commandInsertWebImage.Execute += new EventHandler(commandInsertWebImage_Execute); CommandManager.Add(commandInsertWebImage); commandInsertExtendedEntry = CommandManager.Add(CommandId.InsertExtendedEntry, commandInsertExtendedEntry_Execute); EditorLoaded += new EventHandler(ContentEditor_EditorHtmlReloaded); // QAT CommandManager.Add(new GalleryCommand<CommandId>(CommandId.QAT)); // Outspace CommandManager.Add(new RecentItemsCommand(_postEditingSite)); CommandManager.Add(new GroupCommand(CommandId.InsertImageSplit, CommandManager.Get(CommandId.InsertPictureFromFile))); // WinLive 181138 - A targetted fix to ensure the InsertVideoSplit command is disabled if we don't support InsertVideo (e.g zh-CN doesn't support video) // The problem is related to Windows 7 #712524 & #758433 and this is a work around for this particular case. // The dropdown commands for this (InsertVideoFromFile etc) are already disabled based on the feature support. We explicitly set the state of // group command here so that it has the right state to begin with (otherwise a switch tab/app is required to refresh). GroupCommand commandInsertVideoSplit = new GroupCommand(CommandId.InsertVideoSplit, CommandManager.Get(CommandId.InsertVideoFromFile)); commandInsertVideoSplit.Enabled = MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.VideoProviders); CommandManager.Add(commandInsertVideoSplit); foreach (CommandId commandId in new CommandId[] { CommandId.SplitNew, CommandId.SplitSave, CommandId.SplitPrint, CommandId.PasteSplit, CommandId.FormatTablePropertiesSplit}) { CommandManager.Add(new Command(commandId)); } _commandClosePreview = CommandManager.Add(CommandId.ClosePreview, commandClosePreview_Execute, false); CommandManager.EndUpdate(); }