コード例 #1
0
        private static bool XmlDeserializeWindows8IfIsolatedStorage <T>(string fileName, out T objectToReturn)
        {
            bool handled = false;

            if (fileName.Length > 1 && fileName[0] == '.' && fileName[1] == '/')
            {
                fileName = fileName.Substring(2);
            }

            objectToReturn = default(T);

            if (fileName.Contains(IsolatedStoragePrefix))
            {
                fileName = GetIsolatedStorageFileName(fileName);
                handled  = true;

                var storageFile = GetStorageFile(fileName);


                string asString = FileIO.ReadTextAsync(storageFile).Await();

                objectToReturn = FileManager.XmlDeserializeFromString <T>(asString);
            }

            return(handled);
        }