Example #1
0
        public static string GetModFolderPath(GameFolder gameFolder)
        {
            var localAppDataPath   = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
            var colossalOrderPath  = Path.Combine(localAppDataPath, ColossalOrderFolderName);
            var citiesSkylinesPath = Path.Combine(colossalOrderPath, CitiesSkylinesFolderName);

            var pathAttribute =
                gameFolder.GetType()
                .GetMember(gameFolder.ToString())
                .Single()
                .GetCustomAttributes(typeof(FolderPathAttribute), false)
                .Cast <FolderPathAttribute>()
                .Single();

            return(pathAttribute.Paths.Aggregate(citiesSkylinesPath, Path.Combine));
        }