Exemple #1
0
        public override void OnApplicationStart()
        {
            base.OnApplicationStart();

            // Id - should match output folder name
            Id = "TocAddin";

            // a descriptive name - shows up on labels and tooltips for components
            Name = AddinTitle;


            // by passing in the add in you automatically
            // hook up OnExecute/OnExecuteConfiguration/OnCanExecute
            var menuItem = new AddInMenuItem(this)
            {
                Caption = "Generate TOC",

                // if an icon is specified it shows on the toolbar
                // if not the add-in only shows in the add-ins menu
                FontawesomeIcon = FontAwesomeIcon.Book
            };

            // if you don't want to display config or main menu item clear handler
            menuItem.ExecuteConfiguration = null;

            // Must add the menu to the collection to display menu and toolbar items
            this.MenuItems.Add(menuItem);
        }
        public override void OnApplicationStart()
        {
            base.OnApplicationStart();

            Id = "Snippets";


            // by passing in the add in you automatically
            // hook up OnExecute/OnExecuteConfiguration/OnCanExecute
            var menuItem = new AddInMenuItem(this)
            {
                FontawesomeIcon  = FontAwesomeIcon.PencilSquareOutline,
                Caption          = "Snippets Template Expansions",
                KeyboardShortcut = SnippetsAddinConfiguration.Current.KeyboardShortcut
            };

            try
            {
                menuItem.IconImageSource = new ImageSourceConverter()
                                           .ConvertFromString("pack://application:,,,/SnippetsAddin;component/icon_22.png") as ImageSource;
            }
            catch { }

            // if you don't want to display config or main menu item clear handler
            //menuItem.ExecuteConfiguration = null;

            // Must add the menu to the collection to display menu and toolbar items
            this.MenuItems.Add(menuItem);
        }
        public override Task OnApplicationStart()
        {
            base.OnApplicationStart();

            Id   = "PanDocMarkdownParser";
            Name = "Pandoc Markdown Parser";

            // by passing in the add in you automatically
            // hook up OnExecute/OnExecuteConfiguration/OnCanExecute
            var menuItem = new AddInMenuItem(this)
            {
                Caption = "PanDoc MarkdownParserAddin",

                // if an icon is specified it shows on the toolbar
                // if not the add-in only shows in the add-ins menu
                FontawesomeIcon = FontAwesomeIcon.Exchange,
            };

            menuItem.IconImageSource = new ImageSourceConverter()
                                       .ConvertFromString("pack://application:,,,/PanDocMarkdownParserAddin;component/icon_22.png") as ImageSource;

            // if you don't want to display config or main menu item clear handler
            //menuItem.ExecuteConfiguration = null;

            // Must add the menu to the collection to display menu and toolbar items
            this.MenuItems.Add(menuItem);

            return(Task.CompletedTask);
        }
        public override Task OnApplicationStart()
        {
            base.OnApplicationStart();

            Id = "SaveImageToAzureBlobStorage";

            Name = "Save Image to Azure Blob Storage";

            // by passing in the add in you automatically
            // hook up OnExecute/OnExecuteConfiguration/OnCanExecute
            var menuItem = new AddInMenuItem(this)
            {
                Caption = "Save Image to Azure _Blob Storage",

                // if an icon is specified it shows on the toolbar
                // if not the add-in only shows in the add-ins menu
                FontawesomeIcon      = FontAwesomeIcon.CloudUpload,
                FontawesomeIconColor = "Steelblue"
            };

            menuItem.KeyboardShortcut = "Shift-Alt-B";

            // if you don't want to display main or config menu items clear handler
            //menuItem.ExecuteConfiguration = null;

            // Must add the menu to the collection to display menu and toolbar items
            MenuItems.Add(menuItem);

            return(Task.CompletedTask);
        }
        public override void OnApplicationStart()
        {
            base.OnApplicationStart();

            WeblogModel = new WeblogAddinModel()
            {
                Addin = this,
            };

            Id   = "weblog";
            Name = "Weblog Publishing Addin";

            // Create addin and automatically hook menu events
            var menuItem = new AddInMenuItem(this)
            {
                Caption          = "Weblog Publishing",
                FontawesomeIcon  = FontAwesomeIcon.Rss,
                KeyboardShortcut = WeblogAddinConfiguration.Current.KeyboardShortcut
            };

            try
            {
                menuItem.IconImageSource = new ImageSourceConverter()
                                           .ConvertFromString("pack://application:,,,/WeblogAddin;component/icon_22.png") as ImageSource;
            }
            catch { }


            MenuItems.Add(menuItem);
        }
Exemple #6
0
        /// <summary>
        /// Fired when the Addin is initially loaded. This is very early in
        /// the lifecycle and should only be used to create the addin name
        /// and UI options.
        /// </summary>
        /// <remarks>
        /// You do not have access to the Model or UI from this overload.
        /// </remarks>
        public override void OnApplicationStart()
        {
            base.OnApplicationStart();


            // Id - should match output folder name. REMOVE 'Addin' from the Id
            Id = "$safeprojectname$";

            // a descriptive name - shows up on labels and tooltips for components
            // REMOVE 'Addin' from the Name
            Name = "$safeprojectname$";


            // by passing in the add in you automatically
            // hook up OnExecute/OnExecuteConfiguration/OnCanExecute
            var menuItem = new AddInMenuItem(this)
            {
                Caption = Name,

                // if an icon is specified it shows on the toolbar
                // if not the add-in only shows in the add-ins menu
                FontawesomeIcon = FontAwesomeIcon.Bullhorn
            };

            // if you don't want to display config or main menu item clear handler
            //menuItem.ExecuteConfiguration = null;

            // Must add the menu to the collection to display menu and toolbar items
            MenuItems.Add(menuItem);
        }
Exemple #7
0
        public override void OnApplicationStart()
        {
            base.OnApplicationStart();

            Id = "PasteCodeAsGist";

            // by passing in the add in you automatically
            // hook up OnExecute/OnExecuteConfiguration/OnCanExecute
            AddinMenuItem = new AddInMenuItem(this)
            {
                Caption = "Gist",

                // if an icon is specified it shows on the toolbar
                // if not the add-in only shows in the add-ins menu
                FontawesomeIcon      = FontAwesomeIcon.Github,
                FontawesomeIconColor = "#247CAC"

                                       //IconImageSource = new ImageSourceConverter()
                                       //    .ConvertFromString("pack://application:,,,/GistIntegrationAddin;component/icon_22.png") as ImageSource
            };


            // Must add the menu to the collection to display menu and toolbar items
            MenuItems.Add(AddinMenuItem);
        }
        public override async Task OnApplicationStart()
        {
            AddinModel = new CommanderAddinModel {
                AppModel           = Model,
                AddinConfiguration = CommanderAddinConfiguration.Current,
                Addin = this
            };

            await base.OnApplicationStart();

            Id = "Commander";

            // by passing in the add in you automatically
            // hook up OnExecute/OnExecuteConfiguration/OnCanExecute
            var menuItem = new AddInMenuItem(this)
            {
                Caption          = "Commander C# Script Automation",
                FontawesomeIcon  = FontAwesomeIcon.Terminal,
                KeyboardShortcut = CommanderAddinConfiguration.Current.KeyboardShortcut
            };

            try
            {
                menuItem.IconImageSource = new ImageSourceConverter()
                                           .ConvertFromString("pack://application:,,,/CommanderAddin;component/icon_22.png") as ImageSource;
            }
            catch { }


            // if you don't want to display config or main menu item clear handler
            //menuItem.ExecuteConfiguration = null;
            // Must add the menu to the collection to display menu and toolbar items
            MenuItems.Add(menuItem);
        }
Exemple #9
0
        public override void OnApplicationStart()
        {
            base.OnApplicationStart();

            Id = "screencapture";

            // create menu item and use OnExecute/OnExecuteConfiguration/OnCanExecute handlers
            var menuItem = new AddInMenuItem(this)
            {
                Caption         = "SnagIt Screen Capture",
                FontawesomeIcon = FontAwesomeIcon.Camera
            };

            this.MenuItems.Add(menuItem);
        }
        /// <summary>
        /// Fired when the Addin is initially loaded. This is very early in
        /// the lifecycle and should only be used to create the addin name
        /// and UI options.
        /// </summary>
        /// <remarks>
        /// You do not have access to the Model or UI from this overload.
        /// </remarks>
        public override void OnApplicationStart()
        {
            base.OnApplicationStart();

            // Id - should match output folder name. REMOVE 'Addin' from the Id
            Id = "TocUpdater";

            // a descriptive name - shows up on labels and tooltips for components
            // REMOVE 'Addin' from the Name
            Name = "TOC Updater";

            // by passing in the add in you automatically
            // hook up OnExecute/OnExecuteConfiguration/OnCanExecute
            var menuItem = new AddInMenuItem(this)
            {
                Caption = Name,

                // if an icon is specified it shows on the toolbar
                // if not the add-in only shows in the add-ins menu
                FontawesomeIcon = FontAwesomeIcon.Magic
            };

            try
            {
                // We want a different icon based on the user selected theme
                var theme    = Application.Current.Resources["Theme.BaseColorScheme"] as string;
                var iconFile = theme == "Dark" ? "Icon_22_Dark" : "Icon_22_Light";

                var icon = new BitmapImage();
                icon.BeginInit();
                icon.UriSource   = new Uri($"pack://application:,,,/TocUpdaterAddin;component/Assets/{iconFile}.png", UriKind.RelativeOrAbsolute);
                icon.CacheOption = BitmapCacheOption.OnLoad;
                icon.EndInit();
                icon.Freeze();

                menuItem.IconImageSource = icon;
            }
            catch
            {
                // We did not recieve the icon. We will get the fallback value automatically, so no need to react here.
            }

            // if you don't want to display config or main menu item clear handler
            //menuItem.ExecuteConfiguration = null;

            // Must add the menu to the collection to display menu and toolbar items
            MenuItems.Add(menuItem);
        }
        public override void OnApplicationStart()
        {
            base.OnApplicationStart();

            Id = "weblog";

            // Create addin and automatically hook menu events
            var menuItem = new AddInMenuItem(this)
            {
                Caption          = "Weblog Publishing",
                FontawesomeIcon  = FontAwesomeIcon.Rss,
                KeyboardShortcut = WeblogAddinConfiguration.Current.KeyboardShortcut
            };

            MenuItems.Add(menuItem);
        }
        public override void OnApplicationStart()
        {
            base.OnApplicationStart();

            Id = "weblog";

            // Create addin and automatically hook menu events
            var menuItem = new AddInMenuItem(this)
            {
                Caption         = "Weblog Publishing",
                FontawesomeIcon = FontAwesomeIcon.Rss
            };

            // Don't need a configuration dropdown
            menuItem.ExecuteConfiguration = null;

            MenuItems.Add(menuItem);
        }
Exemple #13
0
        public override async Task OnApplicationStart()
        {
            await base.OnApplicationStart();


            // Id - should match output folder name. REMOVE 'Addin' from the Id
            Id = "Console";

            // a descriptive name - shows up on labels and tooltips for components
            // REMOVE 'Addin' from the Name
            Name = "Console Addin";


            // by passing in the add in you automatically
            // hook up OnExecute/OnExecuteConfiguration/OnCanExecute
            var menuItem = new AddInMenuItem(this)
            {
                Caption = Name,

                // if an icon is specified it shows on the toolbar
                // if not the add-in only shows in the add-ins menu
                FontawesomeIcon = FontAwesomeIcon.Bullhorn
            };

            try
            {
                menuItem.IconImageSource = new ImageSourceConverter()
                                           .ConvertFromString("pack://application:,,,/ConsoleAddin;component/icon_22.png") as ImageSource;
            }
            catch
            {
            }

            // if you don't want to display config or main menu item clear handler
            //menuItem.ExecuteConfiguration = null;

            // Must add the menu to the collection to display menu and toolbar items
            this.MenuItems.Add(menuItem);
        }
Exemple #14
0
        public override void OnApplicationStart()
        {
            base.OnApplicationStart();

            Id = "CodeProjectMarkdownParserAddin";

            Name = "CodeProject Markdown Parser";

            AddInMenuItem menuItem = new AddInMenuItem(this)
            {
                Caption         = "Copy HTML to Clipboard",
                FontawesomeIcon = FontAwesomeIcon.Clipboard
            };

            // if you don't want to display config or main menu item clear handler
            menuItem.ExecuteConfiguration = null;

            // Must add the menu to the collection to display menu and toolbar items
            MenuItems.Add(menuItem);

            EnsureThemeExists();
        }
Exemple #15
0
        public override void OnApplicationStart()
        {
            base.OnApplicationStart();

            Id = "SaveToAzureBlogStorage";

            // by passing in the add in you automatically
            // hook up OnExecute/OnExecuteConfiguration/OnCanExecute
            var menuItem = new AddInMenuItem(this)
            {
                Caption = "Save Image to Azure Blob Storage",

                // if an icon is specified it shows on the toolbar
                // if not the add-in only shows in the add-ins menu
                FontawesomeIcon = FontAwesomeIcon.CloudUpload,
            };

            // if you don't want to display main or config menu items clear handler
            menuItem.ExecuteConfiguration = null;

            // Must add the menu to the collection to display menu and toolbar items
            MenuItems.Add(menuItem);
        }
        public override void OnApplicationStart()
        {
            base.OnApplicationStart();

            Id = "SampleAddin";

            // by passing in the add in you automatically
            // hook up OnExecute/OnExecuteConfiguration/OnCanExecute
            var menuItem = new AddInMenuItem(this)
            {
                Caption = "Sample Add in",

                // if an icon is specified it shows on the toolbar
                // if not the add-in only shows in the add-ins menu
                FontawesomeIcon = FontAwesomeIcon.Bullhorn
            };

            // if you don't want to display config or main menu item clear handler
            //menuItem.ExecuteConfiguration = null;

            // Must add the menu to the collection to display menu and toolbar items
            this.MenuItems.Add(menuItem);
        }
        public override void OnApplicationStart()
        {
            base.OnApplicationStart();

            var menuItem =
                new AddInMenuItem(this)
            {
                Caption = "ImgurUploader", FontawesomeIcon = FontAwesomeIcon.Image
            };

            try
            {
                menuItem.IconImageSource = new ImageSourceConverter().ConvertFromString(
                    "pack://application:,,,/MarkdownMonsterImgurUploaderAddin;component/Assets/imgur-uploader_32x32.png")
                                           as ImageSource;
            }
            catch
            {
                // ignored
            }

            this.MenuItems.Add(menuItem);
        }
Exemple #18
0
        public override void OnApplicationStart()
        {
            base.OnApplicationStart();

            Id = "screencapture";

            // create menu item and use OnExecute/OnExecuteConfiguration/OnCanExecute handlers
            var menuItem = new AddInMenuItem(this)
            {
                Caption          = "Screen Capture",
                FontawesomeIcon  = FontAwesomeIcon.Camera,
                KeyboardShortcut = ScreenCaptureConfiguration.Current.KeyboardShortcut
            };

            MenuItems.Add(menuItem);


            try
            {
                menuItem.IconImageSource = new ImageSourceConverter()
                                           .ConvertFromString("pack://application:,,,/ScreenCaptureAddin;component/icon_22.png") as ImageSource;
            }
            catch { }
        }