Example #1
0
 public static void Init(IModuleManager mm)
 {
     if (Current == null)
     {
         Current = new FarPodContext(mm);
     }
 }
Example #2
0
        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;
                }
            }
        }
Example #3
0
        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;
                }
            }
        }
Example #4
0
        protected FarPodContext(IModuleManager mm)
        {
            DeviceSource = new FarPodDeviceService();

            ModuleManager = mm;
        }