public static void SaveObjectData(string fileName)
        {
            PresetManager.DirectoryCheckAndCreate();
            ObjectData    objectDataFromObject = PresetManager.GetObjectDataFromObject();
            XmlSerializer xmlSerializer        = new XmlSerializer(typeof(ObjectData));
            StreamWriter  streamWriter         = new StreamWriter(PresetManager.directoryPath + fileName + ".xml", false, new UTF8Encoding(false));

            xmlSerializer.Serialize(streamWriter, objectDataFromObject);
            streamWriter.Close();
            PresetFileData presetFileData = new PresetFileData();

            presetFileData.filename   = fileName;
            presetFileData.objectData = objectDataFromObject;
            PresetManager.PresetFileDataDic[fileName] = presetFileData;
        }
        private static void LoadPresetFileList()
        {
            PresetManager.presetFileDataDic = new SortedDictionary <string, PresetFileData>();
            bool flag = !Directory.Exists(PresetManager.directoryPath);

            if (!flag)
            {
                string[] files = Directory.GetFiles(PresetManager.directoryPath, "*.xml", SearchOption.TopDirectoryOnly);
                foreach (string path in files)
                {
                    string         fileNameWithoutExtension = Path.GetFileNameWithoutExtension(path);
                    PresetFileData presetFileData           = new PresetFileData();
                    presetFileData.filename = fileNameWithoutExtension;
                    XmlSerializer xmlSerializer = new XmlSerializer(typeof(ObjectData));
                    StreamReader  streamReader  = new StreamReader(path, new UTF8Encoding(false));
                    presetFileData.objectData = (ObjectData)xmlSerializer.Deserialize(streamReader);
                    streamReader.Close();
                    PresetManager.presetFileDataDic[fileNameWithoutExtension] = presetFileData;
                }
            }
        }