private void SavetTestResult(Survey survey, XDocument documentXML) { String dataToSave; if ((bool)OperationsOnSettings.Instance.IsEncryptionEnabled) { AESEncryption encrypter = new AESEncryption(); dataToSave = encrypter.Encrypt(documentXML.ToString(), App.AppDictionary["EncryptionPassword"] as String, "qwhmvbzx"); } else { dataToSave = documentXML.ToString(); } using (IsolatedStorageFile isolatedStorage = IsolatedStorageFile.GetUserStoreForApplication()) { String directoryPath = String.Format("surveys/{0}", survey.Id); string resultFilePath = System.IO.Path.Combine(directoryPath, String.Format("r_{0}.xml", survey.ResultInfo.Id)); if (!isolatedStorage.DirectoryExists(directoryPath)) { isolatedStorage.CreateDirectory(directoryPath); } using (IsolatedStorageFileStream isoStream = new IsolatedStorageFileStream(resultFilePath, FileMode.Create, isolatedStorage)) { StreamWriter writer = new StreamWriter(isoStream); writer.Write(dataToSave); writer.Close(); } } OperationsOnListOfResults operationsOnListOfResults = new OperationsOnListOfResults(SurveyId); operationsOnListOfResults.Add(survey.ResultInfo); }
private void AddResultToList() { OperationsOnListOfResults operationsOnListOfResults = new OperationsOnListOfResults(Id); operationsOnListOfResults.Add(ResultInfo); }