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


C# FileOpenPicker.PickSingleFileAndContinue方法代码示例

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


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

示例1: LaunchFileSelectionServiceAsync

        public Task LaunchFileSelectionServiceAsync()
        {
            FileOpenPicker picker = new FileOpenPicker();
            picker.FileTypeFilter.Add(".dat");
            Task task = null;

            #if WINDOWS_PHONE_APP

            this.completionSource = new TaskCompletionSource<int>();
            picker.PickSingleFileAndContinue();
            task = this.completionSource.Task;

            #endif
            #if WINDOWS_APP

            task = picker.PickSingleFileAsync().AsTask().ContinueWith(
              fileTask =>
              {
                  this.storageFile = fileTask.Result;
              });

            #endif

            return task;
        }
开发者ID:AnatoliyKapustin,项目名称:Practice_DigitalCloudTechnologies,代码行数:25,代码来源:FileSelectionService.cs

示例2: Execute

        public async void Execute(object parameter)
        {
            try
            {
                App.OpenFilePickerReason = OpenFilePickerReason.OnOpeningVideo;
                var picker = new FileOpenPicker
                {
                    ViewMode = PickerViewMode.List,
                    SuggestedStartLocation = PickerLocationId.VideosLibrary
                };
                foreach (var ext in _allowedExtensions)
                    picker.FileTypeFilter.Add(ext);


#if WINDOWS_APP
                StorageFile file = null;
                file = await picker.PickSingleFileAsync();
                if (file != null)
                {
                    LogHelper.Log("Opening file: " + file.Path);
                    await Locator.MediaPlaybackViewModel.OpenFile(file);
                }
                else
                {
                    LogHelper.Log("Cancelled");
                }
                App.OpenFilePickerReason = OpenFilePickerReason.Null;
#else
            picker.PickSingleFileAndContinue();
#endif
            }
            catch { }
        }
开发者ID:robUx4,项目名称:vlc-winrt,代码行数:33,代码来源:PickVideoCommand.cs

示例3: Button_Click

        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            if (file == null)
            {
                var openPicker = new FileOpenPicker
                {
                    SuggestedStartLocation = PickerLocationId.PicturesLibrary,
                    ViewMode = PickerViewMode.Thumbnail
                };
                openPicker.FileTypeFilter.Add(".jpg");
                openPicker.PickSingleFileAndContinue();
                button.Content = "Upload";
            }
            else
            {
                var config = await GoogleConfig.Create(
                    "517285908032-12332132132131321312.apps.googleusercontent.com",
                    new List<string>(new string[] { "https://www.googleapis.com/auth/drive" }),
                    "google"
                );

                //var config = await KeycloakConfig.Create("shoot-third-party", "https://localhost:8443", "shoot-realm");
                //var config = FacebookConfig.Create("1654557457742519", "9cab3cb953d3194908f44f1764b5b921", 
                //    new List<string>(new string[] { "photo_upload, publish_actions" }), "facebook");

                var module = await AccountManager.AddAccount(config);
                if (await module.RequestAccessAndContinue())
                {
                    Upload(module);
                }
            }
        }
开发者ID:valaypatel,项目名称:aerogear-windows-oauth2,代码行数:32,代码来源:MainPage.xaml.cs

示例4: Execute

        public async override void Execute(object parameter)
        {
            var album = parameter as AlbumItem;

            if (album == null)
            {
                var args = parameter as ItemClickEventArgs;
                if(args != null)
                album = args.ClickedItem as AlbumItem;
            }

            var openPicker = new FileOpenPicker
            {
                ViewMode = PickerViewMode.Thumbnail,
                SuggestedStartLocation = PickerLocationId.PicturesLibrary
            };
            openPicker.FileTypeFilter.Add(".jpg");
            openPicker.FileTypeFilter.Add(".jpeg");
            openPicker.FileTypeFilter.Add(".png");
            openPicker.FileTypeFilter.Add(".gif");
            // Windows Phone launches the picker, then freezes the app. We need
            // to pick it up again on OnActivated.
#if WINDOWS_PHONE_APP
            App.OpenFilePickerReason = OpenFilePickerReason.OnPickingAlbumArt;
            App.SelectedAlbumItem = album;
            openPicker.PickSingleFileAndContinue();
#else
            var file = await openPicker.PickSingleFileAsync();
            if (file == null) return;
            var byteArray = await ConvertImage.ConvertImagetoByte(file);
            await App.MusicMetaService.SaveAlbumImageAsync(album, byteArray);
            await Locator.MusicLibraryVM._albumDatabase.Update(album);
#endif
        }
开发者ID:robUx4,项目名称:vlc-winrt,代码行数:34,代码来源:ChangeAlbumArtCommand.cs

示例5: Image_Tapped

 private void Image_Tapped(object sender, TappedRoutedEventArgs e)
 {
     FileOpenPicker openPicker = new FileOpenPicker();
     openPicker.FileTypeFilter.Add(".jpg");
     openPicker.ContinuationData["Operation"] = "Image";
     openPicker.PickSingleFileAndContinue();
 }
开发者ID:x01673,项目名称:BCMeng_Project,代码行数:7,代码来源:NewOrEditView.xaml.cs

示例6: BtnBrowse_OnClick

 private void BtnBrowse_OnClick(object sender, RoutedEventArgs e)
 {
     var picker = new FileOpenPicker();
     picker.FileTypeFilter.Add(".gif");
     picker.ContinuationData["context"] = "addGifImage";
     picker.PickSingleFileAndContinue();
 }
开发者ID:thomaslevesque,项目名称:XamlAnimatedGif,代码行数:7,代码来源:GifTestPage.xaml.cs

示例7: sendFile

 private async Task sendFile(string peer)
 {
     selectedPeer = peer;
     FileOpenPicker picker = new FileOpenPicker();
     picker.SuggestedStartLocation = PickerLocationId.Downloads;
     picker.FileTypeFilter.Add("*");
     picker.PickSingleFileAndContinue();
 }
开发者ID:nidzo732,项目名称:FileTransfer,代码行数:8,代码来源:MainPage.xaml.cs

示例8: UploadFile

        protected async void UploadFile()
        {
            FileOpenPicker filePicker = new FileOpenPicker();

            filePicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;

            filePicker.PickSingleFileAndContinue();
        }
开发者ID:flashwave,项目名称:puush-wp,代码行数:8,代码来源:MainPage.xaml.cs

示例9: Button_SelectFile_Click

		private void Button_SelectFile_Click(object sender, EventArgs e)
		{
			FileOpenPicker picker = new FileOpenPicker();
			picker.FileTypeFilter.Add(".txt");
			picker.ViewMode = PickerViewMode.Thumbnail;
			picker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
			picker.PickSingleFileAndContinue();
		}
开发者ID:crazymouse0,项目名称:iReader,代码行数:8,代码来源:StartPage.xaml.cs

示例10: ShowFileOpen

        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>

#if WINDOWS_PHONE_APP

        private void ShowFileOpen(CompressAlgorithm? Algorithm)
        {
            var picker = new FileOpenPicker();

            picker.FileTypeFilter.Add("*");

            picker.ContinuationData["Operation"] = "CompressFile";
            picker.ContinuationData["CompressAlgorithm"] = Algorithm.ToString(); 

            picker.PickSingleFileAndContinue();
        }
开发者ID:COMIsLove,项目名称:Windows-universal-samples,代码行数:19,代码来源:Scenario1.xaml.cs

示例11: newProjectButton_Click

 private void newProjectButton_Click(object sender, RoutedEventArgs e)
 {
     var picker = new FileOpenPicker()
     {
         ViewMode = PickerViewMode.Thumbnail,
         CommitButtonText = "Select framing image",
         SuggestedStartLocation = PickerLocationId.PicturesLibrary,
     };
     picker.FileTypeFilter.Add(".jpg");
     picker.PickSingleFileAndContinue();
 }
开发者ID:mooso,项目名称:Composographer,代码行数:11,代码来源:MainPage.xaml.cs

示例12: LaunchPicker

        private void LaunchPicker()
        {
            FileOpenPicker openPicker = new FileOpenPicker();
            openPicker.ViewMode = PickerViewMode.Thumbnail;
            openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
            openPicker.FileTypeFilter.Add(".jpg");
            openPicker.FileTypeFilter.Add(".jpeg");
            openPicker.FileTypeFilter.Add(".png");

            // Launch file open picker and caller app is suspended and may be terminated if required
            openPicker.PickSingleFileAndContinue();
        }
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:12,代码来源:LoadPhoto.xaml.cs

示例13: PickAFileButton_Click

        private void PickAFileButton_Click(object sender, RoutedEventArgs e)
        {
            FileOpenPicker openPicker = new FileOpenPicker();
            openPicker.ViewMode = PickerViewMode.Thumbnail;
            openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
            openPicker.FileTypeFilter.Add(".mp4");
            openPicker.FileTypeFilter.Add(".wmv");
            openPicker.FileTypeFilter.Add(".avi");

            // Launch file open picker and caller app is suspended and may be terminated if required
            openPicker.PickSingleFileAndContinue();
        }
开发者ID:jm991,项目名称:Helios,代码行数:12,代码来源:MainPage.xaml.cs

示例14: CreateSoundFromMediaLibrary

        public void CreateSoundFromMediaLibrary(Sprite sprite)
        {
            var openPicker = new FileOpenPicker
            {
                ViewMode = PickerViewMode.List,
                SuggestedStartLocation = PickerLocationId.MusicLibrary
            };

            foreach (var extension in SupportedFileTypes)
                openPicker.FileTypeFilter.Add(extension);

            openPicker.PickSingleFileAndContinue();
        }
开发者ID:Catrobat,项目名称:CatrobatForWindows,代码行数:13,代码来源:SoundServiceWindowsShared.cs

示例15: PickFileForDemoClick

        private async void PickFileForDemoClick(object sender, RoutedEventArgs e)
        {
            var picker = new FileOpenPicker()
            {
                FileTypeFilter = { ".txt" },
                SuggestedStartLocation = PickerLocationId.DocumentsLibrary
            };

#if WINDOWS_PHONE_APP
            picker.PickSingleFileAndContinue();
#elif WINDOWS_APP
            fileToUse = await picker.PickSingleFileAsync();
#endif
        }
开发者ID:luiseduardohdbackup,项目名称:Windows-Universal,代码行数:14,代码来源:MainPage.xaml.cs


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