コード例 #1
0
        private static string GetApplicationCacheDirectory()
        {
#if SILICONSTUDIO_PLATFORM_ANDROID
            var directory = Path.Combine(PlatformAndroid.Context.FilesDir.AbsolutePath, "cache");
            Directory.CreateDirectory(directory);
            return(directory);
#elif SILICONSTUDIO_PLATFORM_WINDOWS_STORE
            var directory = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "cache");
            NativeFile.DirectoryCreate(directory);
            return(directory);
#elif SILICONSTUDIO_PLATFORM_WINDOWS_PHONE
            return(Windows.Storage.ApplicationData.Current.LocalCacheFolder.Path);
#elif SILICONSTUDIO_PLATFORM_IOS
            var directory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "..", "Library", "Caches");
            Directory.CreateDirectory(directory);
            return(directory);
#else
            // TODO: Should we add "local" ?
            var directory = Path.Combine(GetApplicationBinaryDirectory(), "cache");
            Directory.CreateDirectory(directory);
            return(directory);
#endif
        }