FSpot.Driver.UpdatePlugins()

Here are the examples of the csharp api class FSpot.Driver.UpdatePlugins() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

1. Example

Project: f-spot
Source File: main.cs
static void InitializeAddins ()
		{
			uint timer = Log.InformationTimerStart ("Initializing Mono.Addins");
			try {
				UpdatePlugins ();
			} catch (Exception) {
				Log.Debug ("Failed to initialize plugins, will remove addin-db and try again.");
				ResetPluginDb ();
			}

			var setupService = new SetupService (AddinManager.Registry);
			foreach (AddinRepository repo in setupService.Repositories.GetRepositories ()) {
				if (repo.Url.StartsWith ("http://addins.f-spot.org/")) {
					Log.InformationFormat ("Unregistering {0}", repo.Url);
					setupService.Repositories.RemoveRepository (repo.Url);
				}
			}
			Log.DebugTimerPrint (timer, "Mono.Addins Initialization took {0}");
		}

2. Example

Project: f-spot
Source File: main.cs
static void ResetPluginDb ()
		{
			// Nuke addin-db
			var directory = GLib.FileFactory.NewForUri (new SafeUri (Global.BaseDirectory));
			using (var list = directory.EnumerateChildren ("standard::name", GLib.FileQueryInfoFlags.None, null)) {
				foreach (GLib.FileInfo info in list) {
					if (info.Name.StartsWith ("addin-db-")) {
						var file = GLib.FileFactory.NewForPath (Path.Combine (directory.Path, info.Name));
						file.DeleteRecursive ();
					}
				}
			}

			// Try again
			UpdatePlugins ();
		}