6 internal class GConfConfig
: IConfig
8 GConf
.Client c
= new GConf
.Client();
9 Config
.Callback UpdateCallback
;
11 static string path
= "/apps/eithne/";
13 public GConfConfig(Config
.Callback UpdateCallback
)
15 this.UpdateCallback
= UpdateCallback
;
17 c
.AddNotify(path
.TrimEnd(new char[] {'/'}
), UpdateHandler
);
20 private void UpdateHandler(object o
, EventArgs args
)
25 public void Set(string key
, string val
)
27 c
.Set(path
+ key
, val
);
30 public void Set(string key
, int val
)
32 c
.Set(path
+ key
, val
);
35 public void Set(string key
, bool val
)
37 c
.Set(path
+ key
, val
);
40 public string Get(string key
, string def
)
44 return (string)c
.Get(path
+ key
);
46 catch(GConf
.NoSuchKeyException
)
48 c
.Set(path
+ key
, def
);
53 public int Get(string key
, int def
)
57 return (int)c
.Get(path
+ key
);
59 catch(GConf
.NoSuchKeyException
)
61 c
.Set(path
+ key
, def
);
66 public bool Get(string key
, bool def
)
70 return (bool)c
.Get(path
+ key
);
72 catch(GConf
.NoSuchKeyException
)
74 c
.Set(path
+ key
, def
);