示例#1
0
文件: Config.cs 项目: zerkms/shary
        private void Init(System.Configuration.Configuration config)
        {
            HotkeysSection hotkeys;
            if (config.GetSection("Hotkeys") == null)
            {
                hotkeys = new HotkeysSection();
                hotkeys.SectionInformation.ForceSave = true;
                config.Sections.Add("Hotkeys", hotkeys);
            }
            else
            {

                hotkeys = config.Sections["Hotkeys"] as HotkeysSection;
            }

            if (hotkeys.Select.Key == "")
            {
                hotkeys.Select = new HotkeyElement("R", "Alt+Shift");
            }

            StoragesSection storages;
            if (config.GetSection("Storages") == null)
            {
                storages = new StoragesSection();
                storages.SectionInformation.ForceSave = true;
                config.Sections.Add("Storages", storages);
            }
        }
示例#2
0
文件: Config.cs 项目: zerkms/shary
        private void Init(System.Configuration.Configuration config)
        {
            HotkeysSection hotkeys;

            if (config.GetSection("Hotkeys") == null)
            {
                hotkeys = new HotkeysSection();
                hotkeys.SectionInformation.ForceSave = true;
                config.Sections.Add("Hotkeys", hotkeys);
            }
            else
            {
                hotkeys = config.Sections["Hotkeys"] as HotkeysSection;
            }

            if (hotkeys.Select.Key == "")
            {
                hotkeys.Select = new HotkeyElement("R", "Alt+Shift");
            }

            StoragesSection storages;

            if (config.GetSection("Storages") == null)
            {
                storages = new StoragesSection();
                storages.SectionInformation.ForceSave = true;
                config.Sections.Add("Storages", storages);
            }
        }