当前位置: 首页>>代码示例>>C#>>正文


C# FileSavePicker.PickSaveFileAndContinue方法代码示例

本文整理汇总了C#中Windows.Storage.Pickers.FileSavePicker.PickSaveFileAndContinue方法的典型用法代码示例。如果您正苦于以下问题:C# FileSavePicker.PickSaveFileAndContinue方法的具体用法?C# FileSavePicker.PickSaveFileAndContinue怎么用?C# FileSavePicker.PickSaveFileAndContinue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Windows.Storage.Pickers.FileSavePicker的用法示例。


在下文中一共展示了FileSavePicker.PickSaveFileAndContinue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TrySaveAudio

        private void TrySaveAudio(string audioFileName)
        {
            var picker = new FileSavePicker();
            picker.ContinuationData.Add("OriginalFileName", audioFileName);
            picker.FileTypeChoices["Audio files"] = new List<string> { ".wav" };
            picker.SuggestedFileName = Path.GetFileNameWithoutExtension(audioFileName);
            picker.DefaultFileExtension = ".wav";
            picker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;

            picker.PickSaveFileAndContinue();
        }
开发者ID:khmylov,项目名称:talk-windows-phone-sharing,代码行数:11,代码来源:MainPage.xaml.cs

示例2: SaveFileButton_Click

        private void SaveFileButton_Click(object sender, RoutedEventArgs e)
        {
            // Clear previous returned file name, if it exists, between iterations of this scenario
            OutputTextBlock.Text = "";

            FileSavePicker savePicker = new FileSavePicker();
            savePicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
            // Dropdown of file types the user can save the file as
            savePicker.FileTypeChoices.Add("Plain Text", new List<string>() { ".txt" });
            // Default file name if the user does not type one in or select a file to replace
            savePicker.SuggestedFileName = "New Document";

            savePicker.PickSaveFileAndContinue();
        }
开发者ID:badreddine-dlaila,项目名称:Windows-8.1-Universal-App,代码行数:14,代码来源:Scenario4_SaveFile.xaml.cs

示例3: ExportMenuFlyoutItem_Click

        private async void ExportMenuFlyoutItem_Click(object sender, RoutedEventArgs e)
        {
            var timetable = (TimetableDescription)((FrameworkElement)sender).DataContext;
            if (timetable.FileName == App.Timetable.FileName)
                await TimetableIO.SaveTimetable(App.Timetable);

            var picker = new FileSavePicker();

            string invalidChars = System.Text.RegularExpressions.Regex.Escape(new string(System.IO.Path.GetInvalidFileNameChars()));
            string invalidRegStr = string.Format(@"([{0}]*\.+$)|([{0}]+)", invalidChars);

            picker.SuggestedFileName = System.Text.RegularExpressions.Regex.Replace(timetable.Name, invalidRegStr, "_");
            picker.FileTypeChoices.Add("XML", new List<string>() { ".xml" });

            picker.ContinuationData.Add("FileName", timetable.FileName);
            picker.PickSaveFileAndContinue();
        }
开发者ID:JulianMH,项目名称:ModernTimetable,代码行数:17,代码来源:SelectTimetablePage.xaml.cs

示例4: BackupButton_Click

        private void BackupButton_Click(object sender, RoutedEventArgs e)
        {
            if (App.Locator.Download.ActiveDownloads.Count > 0)
            {
                CurtainPrompt.ShowError("Can't do a backup while there are active downloads.");
                return;
            }

            var savePicker = new FileSavePicker { SuggestedStartLocation = PickerLocationId.DocumentsLibrary };

            // Dropdown of file types the user can save the file as
            savePicker.FileTypeChoices.Add("Audiotica Backup", new List<string> { ".autcp" });

            // Default file name if the user does not type one in or select a file to replace
            savePicker.SuggestedFileName = string.Format("{0}-WP81", DateTime.Now.ToString("MM-dd-yy_H.mm"));

            savePicker.PickSaveFileAndContinue();
        }
开发者ID:jayharry28,项目名称:Audiotica,代码行数:18,代码来源:CollectionSettingsPage.xaml.cs

示例5: SaveToFileButton

        private async void SaveToFileButton(object sender, RoutedEventArgs e)
        {
            FileSavePicker savePicker = new FileSavePicker()
            {
                SuggestedFileName = string.Format("TextDocument-{0}", DateTime.Now.ToString("dd-MMM-yyyy")),
                FileTypeChoices =
                {
                    { "Plain text", new List<string>{ ".txt" }},
                    { "Web Page", new List<string>{ ".html", ".htm" }}
                },
                SuggestedStartLocation = PickerLocationId.DocumentsLibrary,
                CommitButtonText = "Save my text document"
            };

#if WINDOWS_APP
            StorageFile saveFile = await savePicker.PickSaveFileAsync();
            await SaveTextFile(saveFile);
#elif WINDOWS_PHONE_APP
            savePicker.PickSaveFileAndContinue();
#endif
        }
开发者ID:luiseduardohdbackup,项目名称:Windows-Universal,代码行数:21,代码来源:MainPage.xaml.cs

示例6: saveFile

 public void saveFile(string fileName, byte[] fileContents)
 {
     FileSavePicker picker = new FileSavePicker();
     picker.SuggestedStartLocation = PickerLocationId.Downloads;
     string extension, name;
     extension = name = "";
     for (int i = fileName.Length - 1; i >= 0; i--)
     {
         if (fileName[i] == '.')
         {
             extension = fileName.Substring(i);
             name = fileName.Substring(0, i);
             break;
         }
     }
     if (extension == ".") extension += "noex";
     if (extension == "") extension = ".noex";
     if (name == "") name = fileName;
     picker.FileTypeChoices.Add("Downloaded file", new List<string>() { extension });
     picker.SuggestedFileName = name;
     fileContentsToWrite = fileContents;
     picker.PickSaveFileAndContinue();
 }
开发者ID:nidzo732,项目名称:FileTransfer,代码行数:23,代码来源:MainPage.xaml.cs

示例7: OnSaveClick

		private async void OnSaveClick(object sender, RoutedEventArgs e)
		{
			var picker = new FileSavePicker();
			picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
			picker.DefaultFileExtension = ".png";
			picker.FileTypeChoices.Add(new KeyValuePair<string, IList<string>>("Bitmap image", new[] { ".bmp" }.ToList()));
			picker.FileTypeChoices.Add(new KeyValuePair<string, IList<string>>("Png image", new[] { ".png" }.ToList()));
			picker.FileTypeChoices.Add(new KeyValuePair<string, IList<string>>("Jpeg image", new[] { ".jpg", ".jpe", ".jpeg" }.ToList()));
			picker.FileTypeChoices.Add(new KeyValuePair<string, IList<string>>("Gif image", new[] { ".gif" }.ToList()));

#if WINDOWS_PHONE_APP
			picker.ContinuationData["operation"] = MainPageOperation.Save.ToString();
			picker.PickSaveFileAndContinue();
#else
			var file = await picker.PickSaveFileAsync();
			if (file != null)
			{
				this.OnSave(file);
			}
#endif
		}
开发者ID:lallous,项目名称:SvgForXaml,代码行数:21,代码来源:MainPage.xaml.cs

示例8: SaveAsync

        public async Task SaveAsync(IStorageFile file)
        {
            var picker = new FileSavePicker
            {
                SuggestedFileName = file.Name,
            };

            var extension = Path.GetExtension(file.Name);
            if (string.IsNullOrEmpty(extension))
                extension = ".unknown";

            picker.FileTypeChoices.Add("Attachment File",
                new List<string> {extension});


#if WINDOWS_PHONE_APP
            picker.ContinuationData.Add("Source", file.Path);
            picker.PickSaveFileAndContinue();
#else
            var target = await picker.PickSaveFileAsync();
            await Continue(FilePickTargets.Attachments, file, target);
#endif
        }
开发者ID:Confuset,项目名称:7Pass-Remake,代码行数:23,代码来源:FilePickerService.cs

示例9: SaveFileAsync

		private Task<StorageFile> SaveFileAsync(IRandomAccessStream stream)
		{
			// See http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn614994.aspx
			// For ContinuationManager complete implementation.
			// A smaller version of this is also available in the sample and in the App.xaml.cs.
			var tcs = new TaskCompletionSource<StorageFile>();
			EventHandler<FileSavePickerContinuationEventArgs> fileSavedHandler = null;
			fileSavedHandler = (s, e) =>
			{
				ContinuationManager.Current.FilePickerSaved -= fileSavedHandler;
				var file = e.File;
				if (file == null)
					tcs.TrySetCanceled();
				else
					tcs.TrySetResult(file);
			};

			ContinuationManager.Current.FilePickerSaved += fileSavedHandler;

			FileSavePicker filePicker = new FileSavePicker();
			filePicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
			filePicker.FileTypeChoices.Add("ZIP", new List<string>() { ".zip" });
			filePicker.DefaultFileExtension = ".zip";
			filePicker.SuggestedFileName = "Output";
			filePicker.PickSaveFileAndContinue();
			return tcs.Task;
		}
开发者ID:jmiller121,项目名称:arcgis-runtime-samples-dotnet,代码行数:27,代码来源:ExtractData.xaml.cs

示例10: exportButton_Click

        private void exportButton_Click(object sender, RoutedEventArgs e)
        {
            exportDatabase = true;

            FileSavePicker picker = new FileSavePicker();
            picker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
            picker.ContinuationData["Operation"] = "ExportDatabase";
            picker.FileTypeChoices.Add("TextFile", new List<string>() { ".txt" });

            String time = DateTime.Now.ToString();
            time = time.Replace(' ', '_');
            time = time.Replace(":", "");
            time = time.Replace(".", "");

            String fileName = "NihongoSenpaiExport_" + time;

            picker.SuggestedFileName = fileName;
            picker.PickSaveFileAndContinue();
        }
开发者ID:deadkitty,项目名称:Mobile-Computing,代码行数:19,代码来源:MainPage.xaml.cs

示例11: SaveAs_Click

        private async void SaveAs_Click(object sender, RoutedEventArgs e)
#endif
        {
            FileSavePicker picker = new FileSavePicker();
            picker.FileTypeChoices.Add("JPEG image", new string[] { ".jpg" });
            picker.FileTypeChoices.Add("PNG image", new string[] { ".png" });
            picker.FileTypeChoices.Add("BMP image", new string[] { ".bmp" });
            picker.DefaultFileExtension = ".png";
            picker.SuggestedFileName = "Output file";
            picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;

// On Windows Phone, after the picker is launched the app is closed.
#if WINDOWS_PHONE_APP
            picker.PickSaveFileAndContinue();
#else
            var file = await picker.PickSaveFileAsync();
            if (file != null)
            {
                await LoadSaveFileAsync(file);
            }
#endif
        }
开发者ID:ckc,项目名称:WinApp,代码行数:22,代码来源:Scenario2_ImageTransforms.xaml.cs

示例12: SaveImage

 private void SaveImage(FileSavePicker savePicker)
 {
     savePicker.PickSaveFileAndContinue();
 }
开发者ID:ruiapmoraes,项目名称:lumia-imaging-quickstart,代码行数:4,代码来源:MainPage.WindowsPhone.cs

示例13: StartSavePhotoFile

        private void StartSavePhotoFile()
        {
            var filenameFormat = new Windows.ApplicationModel.Resources.ResourceLoader().GetString("PhotoSaveFilenameFormat");
            var filename = String.Format(filenameFormat, DateTime.Now.ToString("yyyyMMddHHmmss"));

            var picker = new FileSavePicker();
            picker.SuggestedFileName = filename;
            picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
            picker.FileTypeChoices.Add(".jpg", new List<string>() { ".jpg" });
            picker.ContinuationData["Operation"] = "SavePhotoFile";
            picker.PickSaveFileAndContinue();

            App.ContinuationEventArgsChanged += App_ContinuationEventArgsChanged;
        }
开发者ID:roachhd,项目名称:filter-explorer,代码行数:14,代码来源:PhotoPageViewModel.cs

示例14: AppBarBtnSave_Click

        ///////////////////////////////////////////////////////////////////////////
        // Use the FileSavePicker to save the photo with the selected file name

        private void AppBarBtnSave_Click(object sender, RoutedEventArgs e)
        {
            var fsp = new FileSavePicker
            {
                DefaultFileExtension = ".jpg",
                SuggestedFileName = "editedPhoto.jpg",
                SuggestedStartLocation = PickerLocationId.PicturesLibrary,
            };
            fsp.FileTypeChoices.Add("JPEG", new List<string> { ".jpg" });
            fsp.PickSaveFileAndContinue();
        }
开发者ID:lorenzofar,项目名称:SLI,代码行数:14,代码来源:Interpret.xaml.cs

示例15: SaveTweaksButton_Click

 private void SaveTweaksButton_Click(object sender, EventArgs e)
 {
     var savePicker = new FileSavePicker()
     {
         DefaultFileExtension = ".xml",
         SuggestedFileName = "Tweaks.xml",
     };
     savePicker.FileTypeChoices.Add("XML file", new List<string>() { ".xml" });
     savePicker.PickSaveFileAndContinue();
 }
开发者ID:kwanice,项目名称:Tweaks,代码行数:10,代码来源:MainPage.xaml.cs


注:本文中的Windows.Storage.Pickers.FileSavePicker.PickSaveFileAndContinue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。