Пример #1
0
        public void ReadPlayerInputSettings()
        {
            string       PATH_DEFAULT = "..//..//..//..//..//Player//Player//Player//PlayerSettingsDefault.xml";
            var          serializer   = new XmlSerializer(typeof(Configuration.PlayerSettings));
            StreamReader file;

            if (ConfigurationFilePath == null)
            {
                _configurationFilePath = PATH_DEFAULT;
            }
            try
            {
                file = new StreamReader(ConfigurationFilePath);
                _readPlayerSettings = (Configuration.PlayerSettings)serializer.Deserialize(file);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exepction {0} occured while reading file", e.ToString());
                file = new StreamReader(PATH_DEFAULT);
                _readPlayerSettings = (Configuration.PlayerSettings)serializer.Deserialize(file);
            }
        }