/// <summary> /// Implementation of the IGreenshotPlugin.Initialize /// </summary> /// <param name="pluginHost">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> /// <returns>true if plugin is initialized, false if not (doesn't show)</returns> public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) { LOG.Debug("Initialize called of " + myAttributes.Name); this.host = pluginHost; this.myAttributes = myAttributes; return true; }
public int CompareTo(object obj) { PluginAttribute other = obj as PluginAttribute; if (other != null) { return(Name.CompareTo(other.Name)); } throw new ArgumentException("object is not a PluginAttribute"); }
public bool Initialize(IGreenshotHost host, PluginAttribute pluginAttribute) { _config = IniConfig.GetIniSection<OovgConfiguration>(); _ctxMenu = new ToolStripMenuItem(); _ctxMenu.Text = "Configure oo.vg"; _ctxMenu.Tag = host; _ctxMenu.Click += _ctxMenu_Click; PluginUtils.AddToContextMenu(host, _ctxMenu); return true; }
/// <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) { this.host = (IGreenshotHost)pluginHost; Attributes = myAttributes; // Get configuration config = IniConfig.GetIniSection<PicasaConfiguration>(); resources = new ComponentResourceManager(typeof(PicasaPlugin)); itemPlugInRoot = new ToolStripMenuItem(); itemPlugInRoot.Text = Language.GetString("picasa", LangKey.Configure); itemPlugInRoot.Tag = host; itemPlugInRoot.Image = (Image)resources.GetObject("Picasa"); itemPlugInRoot.Click += new System.EventHandler(ConfigMenuClick); PluginUtils.AddToContextMenu(host, itemPlugInRoot); Language.LanguageChanged += new LanguageChangedHandler(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<DropboxPluginConfiguration>(); resources = new ComponentResourceManager(typeof(DropboxPlugin)); itemPlugInConfig = new ToolStripMenuItem(); itemPlugInConfig.Text = Language.GetString("dropbox", LangKey.Configure); itemPlugInConfig.Tag = host; itemPlugInConfig.Click += new System.EventHandler(ConfigMenuClick); itemPlugInConfig.Image = (Image)resources.GetObject("Dropbox"); PluginUtils.AddToContextMenu(host, itemPlugInConfig); Language.LanguageChanged += new LanguageChangedHandler(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="captureHost">Use the ICaptureHost interface to register in the MainContextMenu</param> /// <param name="pluginAttribute">My own attributes</param> /// <returns>true if plugin is initialized, false if not (doesn't show)</returns> public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) { this.host = (IGreenshotHost)pluginHost; Attributes = myAttributes; // Get configuration config = IniConfig.GetIniSection<PhotobucketConfiguration>(); resources = new ComponentResourceManager(typeof(PhotobucketPlugin)); itemPlugInConfig = new ToolStripMenuItem(Language.GetString("photobucket", LangKey.configure)); itemPlugInConfig.Tag = host; itemPlugInConfig.Click += delegate { config.ShowConfigDialog(); }; itemPlugInConfig.Image = (Image)resources.GetObject("Photobucket"); PluginUtils.AddToContextMenu(host, itemPlugInConfig); Language.LanguageChanged += new LanguageChangedHandler(OnLanguageChanged); return true; }
/// <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> /// <returns>true if plugin is initialized, false if not (doesn't show)</returns> public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) { this.host = (IGreenshotHost)pluginHost; Attributes = myAttributes; // Get configuration config = IniConfig.GetIniSection<ImgurConfiguration>(); resources = new ComponentResourceManager(typeof(ImgurPlugin)); ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem("Imgur"); itemPlugInRoot.Image = (Image)resources.GetObject("Imgur"); historyMenuItem = new ToolStripMenuItem(Language.GetString("imgur", LangKey.history)); historyMenuItem.Tag = host; historyMenuItem.Click += delegate { ImgurHistory.ShowHistory(); }; itemPlugInRoot.DropDownItems.Add(historyMenuItem); itemPlugInConfig = new ToolStripMenuItem(Language.GetString("imgur", LangKey.configure)); itemPlugInConfig.Tag = host; itemPlugInConfig.Click += delegate { config.ShowConfigDialog(); }; itemPlugInRoot.DropDownItems.Add(itemPlugInConfig); PluginUtils.AddToContextMenu(host, itemPlugInRoot); Language.LanguageChanged += new LanguageChangedHandler(OnLanguageChanged); // retrieve history in the background Thread backgroundTask = new Thread (new ThreadStart(CheckHistory)); backgroundTask.Name = "Imgur History"; backgroundTask.IsBackground = true; backgroundTask.SetApartmentState(ApartmentState.STA); backgroundTask.Start(); 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; }
/// <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> /// <returns>true if plugin is initialized, false if not (doesn't show)</returns> public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) { this.host = (IGreenshotHost)pluginHost; Attributes = myAttributes; return true; }
/// <summary> /// Implementation of the IGreenshotPlugin.Initialize /// </summary> /// <param name="pluginHost">Use the IGreenshotPluginHost interface to register events</param> /// <param name="myAttributes">My own attributes</param> public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) { // Register configuration (don't need the configuration itself) _config = IniConfig.GetIniSection<ConfluenceConfiguration>(); if(_config.IsDirty) { IniConfig.Save(); } try { TranslationManager.Instance.TranslationProvider = new LanguageXMLTranslationProvider(); //resources = new ComponentResourceManager(typeof(ConfluencePlugin)); } catch (Exception ex) { LOG.ErrorFormat("Problem in ConfluencePlugin.Initialize: {0}", ex.Message); return false; } return true; }
/// <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> /// <returns>true if plugin is initialized, false if not (doesn't show)</returns> public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) { this.host = (IGreenshotHost)pluginHost; jiraPluginAttributes = myAttributes; // Register configuration (don't need the configuration itself) config = IniConfig.GetIniSection<JiraConfiguration>(); resources = new ComponentResourceManager(typeof(JiraPlugin)); return true; }
public virtual bool Initialize(IGreenshotPluginHost pluginHost, ICaptureHost captureHost, PluginAttribute myAttributes) { this.host = pluginHost; this.captureHost = captureHost; FogbugzPlugin.FogbugzPluginAttribute = myAttributes; this.host.OnImageEditorOpen += new OnImageEditorOpenHandler(this.ImageEditorOpened); this.config = IniConfig.GetIniSection<FogBugzConfiguration>(); return true; }
/// <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> /// <returns>true if plugin is initialized, false if not (doesn't show)</returns> public virtual bool Initialize(IGreenshotHost greenshotHost, PluginAttribute myAttributes) { LOG.Debug("Initialize called of " + myAttributes.Name); host = greenshotHost; this.myAttributes = myAttributes; OCR_COMMAND = Path.Combine(Path.GetDirectoryName(myAttributes.DllFile), "greenshotocrcommand.exe"); if (!HasMODI()) { LOG.Warn("No MODI found!"); return false; } // Load configuration config = IniConfig.GetIniSection<OCRConfiguration>(); if (config.Language != null) { config.Language = config.Language.Replace("miLANG_","").Replace("_"," "); } return true; }
public bool Initialize(IGreenshotHost pluginHost, PluginAttribute plugin) { return Initialize(pluginHost, new Dictionary<string, object>()); }
/// <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) { LOG.DebugFormat("Initialize called of {0}", myAttributes.Name); List<string> commandsToDelete = new List<string>(); // Check configuration foreach(string command in config.commands) { if (!isCommandValid(command)) { commandsToDelete.Add(command); } } // cleanup foreach (string command in commandsToDelete) { config.runInbackground.Remove(command); config.commandlines.Remove(command); config.arguments.Remove(command); config.commands.Remove(command); } this.host = pluginHost; this.myAttributes = myAttributes; itemPlugInRoot = new ToolStripMenuItem(); itemPlugInRoot.Tag = host; OnIconSizeChanged(this, new PropertyChangedEventArgs("IconSize")); OnLanguageChanged(this, null); itemPlugInRoot.Click += new System.EventHandler(ConfigMenuClick); PluginUtils.AddToContextMenu(host, itemPlugInRoot); Language.LanguageChanged += OnLanguageChanged; coreConfig.PropertyChanged += OnIconSizeChanged; return true; }