private async void ExportBtn_Click(object sender, RoutedEventArgs e) { IStorageFile ExFile = await AppStorage.SaveFileAsync("Text File", new string[] { ".log" }); if (ExFile == null) { return; } await CurrentFile.CopyAndReplaceAsync(ExFile); }
private async void ExportXRBK(object DataContext) { if (TryGetBookItem(DataContext, out BookItem BkItem)) { IStorageFile ISF = await AppStorage.SaveFileAsync("GR Book ( XRBK )", new string[] { ".xrbk" }, BkItem.Title); if (ISF != null) { await ItemProcessor.WriteXRBK(BkItem, ISF); } } }
private async void ExportAuths(object sender, RoutedEventArgs e) { Button Btn = ( Button )sender; Btn.IsEnabled = false; string Tag = ( string )Btn.Tag; IStorageFile ISF = await AppStorage.SaveFileAsync("wenku10 Auth", new List <string>() { ".xml" }, Tag); if (ISF == null) { Btn.IsEnabled = true; return; } try { using (Stream s = await ISF.OpenStreamForWriteAsync()) { await global::GR.Resources.Shared.Storage.GetStream( Tag == "Keys" ?AESMgr.SettingsFile : TokMgr.SettingsFile ).CopyToAsync(s); await s.FlushAsync(); } } catch (Exception) { // Failed to save file } Btn.IsEnabled = true; }