public SettingsForm(BoxConfiguration config) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); InitializeTexts(); combobox_uploadimageformat.Items.Clear(); foreach(OutputFormat format in Enum.GetValues(typeof(OutputFormat))) { combobox_uploadimageformat.Items.Add(format.ToString()); } comboBox_DefaultSize.Items.Clear(); foreach (PictureDisplaySize displaySize in Enum.GetValues(typeof(PictureDisplaySize))) { comboBox_DefaultSize.Items.Add(displaySize.ToString()); } BoxUtils.LoadHistory(); if (config.runtimeBoxHistory.Count > 0) { historyButton.Enabled = true; } else { historyButton.Enabled = false; } }
public SettingsForm(BoxConfiguration config) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); InitializeTexts(); combobox_uploadimageformat.Items.Clear(); foreach (OutputFormat format in Enum.GetValues(typeof(OutputFormat))) { combobox_uploadimageformat.Items.Add(format.ToString()); } comboBox_DefaultSize.Items.Clear(); foreach (PictureDisplaySize displaySize in Enum.GetValues(typeof(PictureDisplaySize))) { comboBox_DefaultSize.Items.Add(displaySize.ToString()); } BoxUtils.LoadHistory(); if (config.runtimeBoxHistory.Count > 0) { historyButton.Enabled = true; } else { historyButton.Enabled = false; } }
/// <summary> /// Implementation of the IGreenshotPlugin.Initialize /// </summary> /// <param name="host">Use the IGreenshotPluginHost interface to register events</param> /// <param name="pluginAttribute">My own attributes</param> public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) { this.host = (IGreenshotHost)pluginHost; Attributes = myAttributes; // Register configuration (don't need the configuration itself) config = IniConfig.GetIniSection <BoxConfiguration>(); resources = new ComponentResourceManager(typeof(BoxPlugin)); ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem(); itemPlugInRoot.Text = "Box"; itemPlugInRoot.Tag = host; itemPlugInRoot.Image = (Image)resources.GetObject("Box"); ToolStripMenuItem itemPlugInHistory = new ToolStripMenuItem(); itemPlugInHistory.Text = lang.GetString(LangKey.History); itemPlugInHistory.Tag = host; itemPlugInHistory.Click += new System.EventHandler(HistoryMenuClick); itemPlugInRoot.DropDownItems.Add(itemPlugInHistory); ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem(); itemPlugInConfig.Text = lang.GetString(LangKey.Configure); itemPlugInConfig.Tag = host; itemPlugInConfig.Click += new System.EventHandler(ConfigMenuClick); itemPlugInRoot.DropDownItems.Add(itemPlugInConfig); PluginUtils.AddToContextMenu(host, itemPlugInRoot); return(true); }
public SettingsForm(BoxConfiguration config) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); AcceptButton = buttonOK; CancelButton = buttonCancel; }
public SettingsForm(BoxConfiguration config) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); AcceptButton = buttonOK; CancelButton = buttonCancel; this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon(); }
/// <summary> /// Implementation of the IGreenshotPlugin.Initialize /// </summary> /// <param name="host">Use the IGreenshotPluginHost interface to register events</param> /// <param name="metadata">IDictionary<string, object></param> /// <returns>true if plugin is initialized, false if not (doesn't show)</returns> public override bool Initialize(IGreenshotHost pluginHost, IDictionary <string, object> metadata) { this.host = (IGreenshotHost)pluginHost; // Register configuration (don't need the configuration itself) config = IniConfig.GetIniSection <BoxConfiguration>(); resources = new ComponentResourceManager(typeof(BoxPlugin)); // Register our configuration SettingsWindow.RegisterSettingsPage <BoxSettingsPage>("settings_plugins,box.settings_title"); return(true); }
/// <summary> /// Implementation of the IGreenshotPlugin.Initialize /// </summary> /// <param name="pluginHost">Use the IGreenshotPluginHost interface to register events</param> /// <param name="pluginAttribute">My own attributes</param> public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute pluginAttribute) { _host = pluginHost; Attributes = pluginAttribute; // Register configuration (don't need the configuration itself) _config = IniConfig.GetIniSection<BoxConfiguration>(); _resources = new ComponentResourceManager(typeof(BoxPlugin)); _itemPlugInConfig = new ToolStripMenuItem { Image = (Image) _resources.GetObject("Box"), Text = Language.GetString("box", LangKey.Configure) }; _itemPlugInConfig.Click += ConfigMenuClick; PluginUtils.AddToContextMenu(_host, _itemPlugInConfig); Language.LanguageChanged += OnLanguageChanged; return true; }
/// <summary> /// Implementation of the IGreenshotPlugin.Initialize /// </summary> /// <param name="pluginHost">Use the IGreenshotPluginHost interface to register events</param> /// <param name="pluginAttribute">My own attributes</param> public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute pluginAttribute) { _host = pluginHost; Attributes = pluginAttribute; // Register configuration (don't need the configuration itself) _config = IniConfig.GetIniSection <BoxConfiguration>(); _resources = new ComponentResourceManager(typeof(BoxPlugin)); _itemPlugInConfig = new ToolStripMenuItem { Image = (Image)_resources.GetObject("Box"), Text = Language.GetString("box", LangKey.Configure) }; _itemPlugInConfig.Click += ConfigMenuClick; PluginUtils.AddToContextMenu(_host, _itemPlugInConfig); Language.LanguageChanged += OnLanguageChanged; return(true); }
/// <summary> /// Implementation of the IGreenshotPlugin.Initialize /// </summary> /// <param name="host">Use the IGreenshotPluginHost interface to register events</param> /// <param name="pluginAttribute">My own attributes</param> public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) { this.host = (IGreenshotHost)pluginHost; Attributes = myAttributes; // Register configuration (don't need the configuration itself) config = IniConfig.GetIniSection<BoxConfiguration>(); resources = new ComponentResourceManager(typeof(BoxPlugin)); ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem(); itemPlugInRoot.Text = "Box"; itemPlugInRoot.Tag = host; itemPlugInRoot.Image = (Image)resources.GetObject("Box"); ToolStripMenuItem itemPlugInHistory = new ToolStripMenuItem(); itemPlugInHistory.Text = lang.GetString(LangKey.History); itemPlugInHistory.Tag = host; itemPlugInHistory.Click += new System.EventHandler(HistoryMenuClick); itemPlugInRoot.DropDownItems.Add(itemPlugInHistory); ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem(); itemPlugInConfig.Text = lang.GetString(LangKey.Configure); itemPlugInConfig.Tag = host; itemPlugInConfig.Click += new System.EventHandler(ConfigMenuClick); itemPlugInRoot.DropDownItems.Add(itemPlugInConfig); PluginUtils.AddToContextMenu(host, itemPlugInRoot); return true; }