public static void Init(IModuleManager mm) { if (Current == null) { Current = new FarPodContext(mm); } }
public static void Load(IModuleManager mm) { lock (_lockObject) { if (!_isLoaded) { foreach (FieldInfo fi in typeof(MsgStr).GetFields( BindingFlags.Static | BindingFlags.Public)) { fi.SetValue(null, mm.GetString(fi.Name)); } _isLoaded = true; } } }
public static void Save(IModuleManager mm) { lock (_lockObject) { if (_isLoaded) { using (IRegistryKey rk = mm.OpenRegistryKey(null, true)) { foreach (FieldInfo fi in typeof(FarPodSettings).GetFields( BindingFlags.Static | BindingFlags.Public)) { rk.SetValue(fi.Name, fi.GetValue(null)); } } _isLoaded = false; } } }
protected FarPodContext(IModuleManager mm) { DeviceSource = new FarPodDeviceService(); ModuleManager = mm; }