コード例 #1
0
        private void commandInsertEmoticon_Execute(object sender, ExecuteEventHandlerArgs args)
        {
            EmoticonsGalleryCommand galleryCommand = (EmoticonsGalleryCommand)sender;
            int newSelectedIndex = args.GetInt(galleryCommand.CommandId.ToString());
            Emoticon emoticon = galleryCommand.Items[newSelectedIndex].Cookie;

            EmoticonsManager.AddToRecent(emoticon);
            using (EditorUndoUnit undo = new EditorUndoUnit(_currentEditor))
            {
                FocusBody();
                InsertHtml(EmoticonsManager.GetHtml(emoticon), HtmlInsertionOptions.MoveCursorAfter);
                undo.Commit();
            }
        }
コード例 #2
0
 void commandInsertablePlugins_ExecuteWithArgs(object sender, ExecuteEventHandlerArgs args)
 {
     string pluginId = commandInsertablePlugins.Items[args.GetInt(commandInsertablePlugins.CommandId.ToString())].Cookie;
     Command command = CommandManager.Get(pluginId);
     command.PerformExecute();
 }
コード例 #3
0
        void imageEffectsGalleryCommand_ExecuteWithArgs(object sender, ExecuteEventHandlerArgs args)
        {
            ImageEffectsGalleryCommand galleryCommand = (ImageEffectsGalleryCommand)sender;
            int newSelectedIndex = args.GetInt(galleryCommand.CommandId.ToString());
            string newDecoratorId = galleryCommand.Items[newSelectedIndex].Cookie;
            ImageDecorator newDecorator = _imageEditingContext.DecoratorsManager.GetImageDecorator(newDecoratorId);

            Debug.Assert(newDecorator != null);

            if (galleryCommand.SelectedItem != newDecorator.Id)
            {
                ImagePropertiesInfo.ImageDecorators.AddDecorator(newDecorator);

                if (!ImagePropertiesInfo.IsEditableEmbeddedImage())
                {
                    // If this is a web image, calling ApplyImageDecorations will keep properties up to date but won't
                    // actually do any decorating, so do it manually. Only borders should be manually decorated.
                    SimpleImageDecoratorContext context = new SimpleImageDecoratorContext(ImagePropertiesInfo);
                    newDecorator.Decorate(context);
                }

                ApplyImageDecorations();
            }
        }
コード例 #4
0
 void commandSemanticHtml_ExecuteWithArgs(object sender, ExecuteEventHandlerArgs args)
 {
     int selectedIndex = args.GetInt(CommandId.SemanticHtmlGallery.ToString());
     IHtmlFormattingStyle style = commandSemanticHtml.Items[selectedIndex] as IHtmlFormattingStyle;
     ApplyHtmlFormattingStyle(style);
 }