Skip to content

Instantly share code, notes, and snippets.

View lindexi's full-sized avatar

lindexi lindexi

View GitHub Profile
// 在用户完成更改并调用CompleteUpdatesAsync之前,阻止对文件的更新
// Before User finished the file Update and call the CompleteUpdatesAsync,it can prevent other updates the file.
CachedFileManager.DeferUpdates(storageFile);
//当完成更改时,其他应用程序才可以对该文件进行更改。
// When the update is complete,the other can update the file
FileUpdateStatus status = await CachedFileManager.CompleteUpdatesAsync(storageFile);
@lindexi
lindexi / xml
Created November 24, 2016 14:25
/// <summary>
/// Uses the local list of accounts and returns an XML formatted string representing the list
/// </summary>
/// <returns>XML formatted list of accounts</returns>
public static string SerializeAccountListToXml()
{
XmlSerializer xmlizer = new XmlSerializer(typeof(List<Account>));
StringWriter writer = new StringWriter();
xmlizer.Serialize(writer, AccountList);