/// <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 <FlickrConfiguration>(); resources = new ComponentResourceManager(typeof(FlickrPlugin)); ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem(); itemPlugInRoot.Text = "Flickr"; itemPlugInRoot.Tag = host; itemPlugInRoot.Image = (Image)resources.GetObject("flickr"); 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(FlickrConfiguration config) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); CancelButton = buttonCancel; AcceptButton = buttonOK; }
public SettingsForm(FlickrConfiguration config) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); CancelButton = buttonCancel; AcceptButton = buttonOK; }
/// <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 = pluginHost; // Register configuration (don't need the configuration itself) config = IniConfig.GetIniSection <FlickrConfiguration>(); resources = new ComponentResourceManager(typeof(FlickrPlugin)); // Register our configuration SettingsWindow.RegisterSettingsPage <FlickrSettingsPage>("settings_plugins,flickr.settings_title"); return(true); }
public SettingsForm(FlickrConfiguration 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_hiddenFromSearch.Items.Clear(); foreach (FlickrNet.HiddenFromSearch hidden in Enum.GetValues(typeof(FlickrNet.HiddenFromSearch))) { combobox_hiddenFromSearch.Items.Add(hidden.ToString()); } combobox_safetyLevel.Items.Clear(); foreach (FlickrNet.SafetyLevel safetyLevel in Enum.GetValues(typeof(FlickrNet.SafetyLevel))) { combobox_safetyLevel.Items.Add(safetyLevel.ToString()); } comboBox_DefaultSize.Items.Clear(); foreach (PictureDisplaySize displaySize in Enum.GetValues(typeof(PictureDisplaySize))) { comboBox_DefaultSize.Items.Add(displaySize.ToString()); } FlickrUtils.LoadHistory(); if (config.runtimeFlickrHistory.Count > 0) { historyButton.Enabled = true; } else { historyButton.Enabled = false; } }
/// <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<FlickrConfiguration>(); _resources = new ComponentResourceManager(typeof(FlickrPlugin)); _itemPlugInConfig = new ToolStripMenuItem(); _itemPlugInConfig.Text = Language.GetString("flickr", LangKey.Configure); _itemPlugInConfig.Tag = _host; _itemPlugInConfig.Image = (Image)_resources.GetObject("flickr"); _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 <FlickrConfiguration>(); _resources = new ComponentResourceManager(typeof(FlickrPlugin)); _itemPlugInConfig = new ToolStripMenuItem(); _itemPlugInConfig.Text = Language.GetString("flickr", LangKey.Configure); _itemPlugInConfig.Tag = _host; _itemPlugInConfig.Image = (Image)_resources.GetObject("flickr"); _itemPlugInConfig.Click += ConfigMenuClick; PluginUtils.AddToContextMenu(_host, _itemPlugInConfig); Language.LanguageChanged += OnLanguageChanged; return(true); }
public SettingsForm(FlickrConfiguration 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_hiddenFromSearch.Items.Clear(); foreach (FlickrNet.HiddenFromSearch hidden in Enum.GetValues(typeof(FlickrNet.HiddenFromSearch))) { combobox_hiddenFromSearch.Items.Add(hidden.ToString()); } combobox_safetyLevel.Items.Clear(); foreach (FlickrNet.SafetyLevel safetyLevel in Enum.GetValues(typeof(FlickrNet.SafetyLevel))) { combobox_safetyLevel.Items.Add(safetyLevel.ToString()); } comboBox_DefaultSize.Items.Clear(); foreach (PictureDisplaySize displaySize in Enum.GetValues(typeof(PictureDisplaySize))) { comboBox_DefaultSize.Items.Add(displaySize.ToString()); } FlickrUtils.LoadHistory(); if (config.runtimeFlickrHistory.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<FlickrConfiguration>(); resources = new ComponentResourceManager(typeof(FlickrPlugin)); ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem(); itemPlugInRoot.Text = "Flickr"; itemPlugInRoot.Tag = host; itemPlugInRoot.Image = (Image)resources.GetObject("flickr"); 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; }