- add progress to edge, dct and fft plugins
[FaRetSys.git] / IPlugin / Config.cs
blob4a9b3f4544d39f1674f8cc6841020488ff42d91a
1 using System;
2 using System.IO;
4 namespace Eithne
6 public class Config
8 public delegate void Callback();
10 private static IConfig cfg = null;
12 public static void Init(Callback UpdateHandler)
14 try
16 cfg = new GConfConfig(UpdateHandler);
18 catch(Exception e)
20 Console.WriteLine("Cannot use GConf based config.");
21 Console.WriteLine(e.Message);
22 Console.WriteLine("Trying to fall back to registry based config.");
24 cfg = new RegistryConfig(UpdateHandler);
28 public static void Set(string key, string val)
30 cfg.Set(key, val);
33 public static void Set(string key, int val)
35 cfg.Set(key, val);
37 public static void Set(string key, bool val)
39 cfg.Set(key, val);
42 public static string Get(string key, string def)
44 return cfg.Get(key, def);
47 public static int Get(string key, int def)
49 return cfg.Get(key, def);
52 public static bool Get(string key, bool def)
54 return cfg.Get(key, def);