Ejemplo n.º 1
0
        public static void ChangeFileSettings(string path, string[] setting)
        {
            // setting[0] - Поле настройки
            // setting[1] - Имя настройки
            // setting[2] - Значение настройки
            if (!File.Exists(path))
            {
                CreateFileSettings(path);
            }
            INIManager manager = new INIManager(path);

            manager.WritePrivateString(setting[0], setting[1], setting[2]);
        }
Ejemplo n.º 2
0
        private static void CreateFileSettings(string path)
        {
            INIManager manager = new INIManager(path);

            manager.WritePrivateString("SizeWindow", "width", "110");
            manager.WritePrivateString("SizeWindow", "height", "33");

            manager.WritePrivateString("Game", "SizeArea", "5");
            manager.WritePrivateString("Game", "ColorAreaBackground", "Black");
            manager.WritePrivateString("Game", "ColorAreaText", "White");
            manager.WritePrivateString("Game", "ColorHighlighting", "Gray");
            manager.WritePrivateString("Game", "ColorHighlightingWord", "Gray");
            manager.WritePrivateString("Game", "ColorGuessedWord", "Red");
            manager.WritePrivateString("Game", "ColorRandomGuessedWord", "True");
        }
Ejemplo n.º 3
0
        public static Dictionary <string, string> GetFileSettings(string path)
        {
            Dictionary <string, string> settings = new Dictionary <string, string>();

            if (!File.Exists(path))
            {
                CreateFileSettings(path);
            }
            INIManager manager = new INIManager(path);

            settings.Add("Width", manager.GetPrivateString("SizeWindow", "width"));
            settings.Add("Height", manager.GetPrivateString("SizeWindow", "height"));

            settings.Add("SizeArea", manager.GetPrivateString("Game", "SizeArea"));
            settings.Add("ColorAreaBackground", manager.GetPrivateString("Game", "ColorAreaBackground"));
            settings.Add("ColorAreaText", manager.GetPrivateString("Game", "ColorAreaText"));
            settings.Add("ColorHighlighting", manager.GetPrivateString("Game", "ColorHighlighting"));
            settings.Add("ColorHighlightingWord", manager.GetPrivateString("Game", "ColorHighlightingWord"));
            settings.Add("ColorGuessedWord", manager.GetPrivateString("Game", "ColorGuessedWord"));
            settings.Add("ColorRandomGuessedWord", manager.GetPrivateString("Game", "ColorRandomGuessedWord"));

            return(settings);
        }