public SettingsForm(DropboxConfiguration 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()); } DropboxUtils.LoadHistory(); if (config.runtimeDropboxHistory.Count > 0) { historyButton.Enabled = true; } else { historyButton.Enabled = false; } }
public SettingsForm(DropboxConfiguration 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()); } DropboxUtils.LoadHistory(); if (config.runtimeDropboxHistory.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 <DropboxConfiguration>(); resources = new ComponentResourceManager(typeof(DropboxPlugin)); // load DropboxAccessToken from file DropboxUtils.LoadAccessToken(); ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem(); itemPlugInRoot.Text = "Dropbox"; itemPlugInRoot.Tag = host; itemPlugInRoot.Image = (Image)resources.GetObject("Dropbox"); 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); }
/// <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<DropboxConfiguration>(); resources = new ComponentResourceManager(typeof(DropboxPlugin)); // load DropboxAccessToken from file DropboxUtils.LoadAccessToken(); ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem(); itemPlugInRoot.Text = "Dropbox"; itemPlugInRoot.Tag = host; itemPlugInRoot.Image = (Image)resources.GetObject("Dropbox"); 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; }