Пример #1
0
        /// <summary>
        /// Saves the current configuration to isolated storage.
        /// </summary>
        /// <param name="name">The filename to use.</param>
        public void SaveSettings(string name)
        {
            XElement settings = new XElement("HealthVaultSettings",
                                             new XElement("Version", SettingsVersion),
                                             new XElement("ApplicationId", AppIdInstance.ToString()),
                                             new XElement("ApplicationCreationToken", ApplicationCreationToken),
                                             new XElement("AuthorizationSessionToken", AuthorizationSessionToken),
                                             new XElement("SharedSecret", SharedSecret),
                                             new XElement("Country", Country),
                                             new XElement("Language", Language),
                                             new XElement("SessionSharedSecret", SessionSharedSecret)
                                             );

            if (CurrentRecord != null)
            {
                settings.Add(new XElement("PersonId", CurrentRecord.PersonId.ToString()),
                             new XElement("RecordId", CurrentRecord.RecordId.ToString()),
                             new XElement("RecordName", CurrentRecord.RecordName));
            }

            MobilePlatform.SaveTextToFile(name, settings.ToString());
        }