public SettingsForm(TFSConfiguration 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()); } TFSUtils.LoadHistory(); if (config.runtimeTfsHistory.Count > 0) { historyButton.Enabled = true; } else { historyButton.Enabled = false; } }
public SettingsForm(TFSConfiguration 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()); } TFSUtils.LoadHistory(); if (config.runtimeTfsHistory.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="captureHost">Use the ICaptureHost interface to register in the MainContextMenu</param> /// <param name="pluginAttribute">My own attributes</param> public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) { try { this.host = (IGreenshotHost)pluginHost; Attributes = myAttributes; // Get configuration config = IniConfig.GetIniSection <TFSConfiguration>(); resources = new ComponentResourceManager(typeof(TFSPlugin)); ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem(); itemPlugInRoot.Text = "TFS"; itemPlugInRoot.Tag = host; //itemPlugInRoot.Image = (Image)resources.GetObject("TFS"); ToolStripMenuItem itemPlugInHistory = new ToolStripMenuItem(); itemPlugInHistory.Text = Language.GetString("tfs", LangKey.History); itemPlugInHistory.Tag = host; itemPlugInHistory.Click += new System.EventHandler(HistoryMenuClick); itemPlugInRoot.DropDownItems.Add(itemPlugInHistory); ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem(); itemPlugInConfig.Text = Language.GetString("tfs", LangKey.Configure); itemPlugInConfig.Tag = host; itemPlugInConfig.Click += new System.EventHandler(ConfigMenuClick); itemPlugInRoot.DropDownItems.Add(itemPlugInConfig); PluginUtils.AddToContextMenu(host, itemPlugInRoot); return(true); } catch (Exception eError) { MessageBox.Show("Error init : " + eError.ToString()); return(false); } }
/// <summary> /// Implementation of the IGreenshotPlugin.Initialize /// </summary> /// <param name="host">Use the IGreenshotPluginHost interface to register events</param> /// <param name="captureHost">Use the ICaptureHost interface to register in the MainContextMenu</param> /// <param name="pluginAttribute">My own attributes</param> public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) { try { this.host = (IGreenshotHost)pluginHost; Attributes = myAttributes; // Get configuration config = IniConfig.GetIniSection<TFSConfiguration>(); resources = new ComponentResourceManager(typeof(TFSPlugin)); ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem(); itemPlugInRoot.Text = "TFS"; itemPlugInRoot.Tag = host; //itemPlugInRoot.Image = (Image)resources.GetObject("TFS"); ToolStripMenuItem itemPlugInHistory = new ToolStripMenuItem(); itemPlugInHistory.Text = Language.GetString("tfs",LangKey.History); itemPlugInHistory.Tag = host; itemPlugInHistory.Click += new System.EventHandler(HistoryMenuClick); itemPlugInRoot.DropDownItems.Add(itemPlugInHistory); ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem(); itemPlugInConfig.Text = Language.GetString("tfs",LangKey.Configure); itemPlugInConfig.Tag = host; itemPlugInConfig.Click += new System.EventHandler(ConfigMenuClick); itemPlugInRoot.DropDownItems.Add(itemPlugInConfig); PluginUtils.AddToContextMenu(host, itemPlugInRoot); return true; } catch (Exception eError) { MessageBox.Show("Error init : " + eError.ToString()); return false; } }