Exemple #1
0
        public static List <PreferenceAudioFilter> Load()
        {
            var result = new List <PreferenceAudioFilter>();

            try {
                using (IsolatedStorageFileStream isfs = new IsolatedStorageFileStream(
                           m_fileName, System.IO.FileMode.Open,
                           IsolatedStorageFile.GetUserStoreForDomain())) {
                    result = PreferenceAudioFilter.LoadFiltersFromStream(isfs);
                }
            } catch (System.Exception ex) {
                Console.WriteLine(ex);
            }

            return(result);
        }
        private static List <PreferenceAudioFilter> TryLoad(string path)
        {
            var result = new List <PreferenceAudioFilter>();

            try {
                using (IsolatedStorageFileStream isfs = new IsolatedStorageFileStream(
                           path, System.IO.FileMode.Open,
                           IsolatedStorageFile.GetUserStoreForDomain())) {
                    result = PreferenceAudioFilter.LoadFiltersFromStream(isfs);
                }
            } catch (System.Exception ex) {
                // file not found
                Console.WriteLine(ex);
                result = null;
            }
            return(result);
        }