/// <summary> /// Implementation of the IPlugin.Configure /// </summary> public virtual void Configure() { ConfluenceConfiguration clonedConfig = _config.Clone(); ConfluenceConfigurationForm configForm = new ConfluenceConfigurationForm(clonedConfig); string url = _config.Url; bool? dialogResult = configForm.ShowDialog(); if (dialogResult.HasValue && dialogResult.Value) { // copy the new object to the old... clonedConfig.CloneTo(_config); IniConfig.Save(); if (_confluenceConnector != null) { if (!url.Equals(_config.Url)) { if (_confluenceConnector.IsLoggedIn) { _confluenceConnector.Logout(); } _confluenceConnector = null; } } } }
/// <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) { host = pluginHost; // Register configuration (don't need the configuration itself) config = IniConfig.GetIniSection <ConfluenceConfiguration>(); if (config.IsDirty) { IniConfig.Save(); } // Register our configuration SettingsWindow.RegisterSettingsPage <ConfluenceSettingsPage>("settings_plugins,confluence.plugin_settings"); 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); }
public ConfluenceConfigurationForm(ConfluenceConfiguration config) { this.DataContext = config; this.config = config; InitializeComponent(); }
/// <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; }