示例#1
0
        private static XmlDocument OpenDocument()
        {
            IsolatedStorageFileStream storageFileStream;

            try
            {
                storageFileStream = new IsolatedStorageFileStream("ApplicationSettings.xml", FileMode.Open, FileAccess.Read);
            }
            catch (FileNotFoundException)
            {
                return(ApplicationSettings.CreateDocument());
            }
            XmlDocument   xmlDocument   = new XmlDocument();
            XmlTextReader xmlTextReader = new XmlTextReader(storageFileStream);

            xmlDocument.Load(xmlTextReader);
            xmlTextReader.Close();
            storageFileStream.Close();
            return(xmlDocument);
        }
示例#2
0
 public void ClearSettings()
 {
     this.Document = ApplicationSettings.CreateDocument();
 }