Пример #1
0
 private void image_Click(object sender, RoutedEventArgs e)
  {
     isPicure = true;
     Config.pictrueType = 1;
     image.IsEnabled = false;
     FileOpenPicker openPicker = new FileOpenPicker();
     openPicker.FileTypeFilter.Add(".jpg");
     openPicker.FileTypeFilter.Add(".png");
     openPicker.ContinuationData["Operation"] = "ImageWeibo";
     openPicker.PickMultipleFilesAndContinue();
 }
Пример #2
0
        private void PickFilesButton_Click(object sender, RoutedEventArgs e)
        {
            // Clear any previously returned files between iterations of this scenario
            OutputTextBlock.Text = "";

            FileOpenPicker openPicker = new FileOpenPicker();
            openPicker.ViewMode = PickerViewMode.List;
            openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
            openPicker.FileTypeFilter.Add("*");

            openPicker.PickMultipleFilesAndContinue();
        }
        private async void LoadMultipleFilesButtonClick(object sender, RoutedEventArgs e)
        {
            var picker = new FileOpenPicker
            {
                ViewMode = PickerViewMode.List,
                SuggestedStartLocation = PickerLocationId.Desktop,
                FileTypeFilter = { "*" }
            };

#if WINDOWS_PHONE_APP
            picker.PickMultipleFilesAndContinue();            
#elif WINDOWS_APP
            IReadOnlyList<StorageFile> files = await picker.PickMultipleFilesAsync();
            foreach (var file in files)
            {
                DisplayFileName(file);
            }
#endif
        }
        async void add()
        {
            try
            {


                FileOpenPicker openPicker = new FileOpenPicker();
                openPicker.ViewMode = PickerViewMode.List;
                openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
                openPicker.FileTypeFilter.Add("*");

                openPicker.PickMultipleFilesAndContinue();
              
                // Launch file open picker and caller app is suspended and may be terminated if required
                //openPicker.PickSingleFileAndContinue();


            }
            catch (Exception e)
            {
                new MessageDialog(e.Message + e.StackTrace).ShowAsync();
            }

        }
        private void StartMultipartUpload_Click(object sender, RoutedEventArgs e)
        {
            // By default 'serverAddressField' is disabled and URI validation is not required. When enabling the text
            // box validating the URI is required since it was received from an untrusted source (user input).
            // The URI is validated by calling Uri.TryCreate() that will return 'false' for strings that are not valid URIs.
            // Note that when enabling the text box users may provide URIs to machines on the intrAnet that require
            // the "Home or Work Networking" capability.
            Uri uri;
            if (!Uri.TryCreate(serverAddressField.Text.Trim(), UriKind.Absolute, out uri))
            {
                rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
                return;
            }

            FileOpenPicker picker = new FileOpenPicker();
            picker.FileTypeFilter.Add("*");

#if WINDOWS_PHONE_APP
            picker.ContinuationData.Add("uri", uri.OriginalString);
            picker.PickMultipleFilesAndContinue();
#else
            StartMultipleFilesUpload(picker, uri);
#endif
        }
 private async void AddButtonClick_OnClick(object sender, RoutedEventArgs e)
 {
     var picker = new FileOpenPicker();
     picker.FileTypeFilter.Add(".jpg");
     picker.PickMultipleFilesAndContinue();
 }
Пример #7
0
 private void PerformAdd()
 {
     var openPicker = new FileOpenPicker();
     openPicker.ViewMode = PickerViewMode.List;
     openPicker.FileTypeFilter.Add(".mp3");
     openPicker.PickMultipleFilesAndContinue();
 }
		private void SelectFilesButton_Clicked(object sender, RoutedEventArgs e)
		{
			FileOpenPicker folderPicker = new FileOpenPicker();
			folderPicker.SuggestedStartLocation = PickerLocationId.Downloads;
			folderPicker.FileTypeFilter.Add(DeviceFirmwareUpdateSettingPageViewModel.ZipFile);
			folderPicker.PickMultipleFilesAndContinue();
		}
Пример #9
0
        private void OpenFile()
        {
            FileOpenPicker openPicker = new FileOpenPicker();
            openPicker.ViewMode = PickerViewMode.List;
            openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
            foreach (string extension in handledExtensions)
            {
                openPicker.FileTypeFilter.Add(extension);
            }

            // Store this instance as the last caller of the continuation code
            ((App)(App.Current)).PickerCaller = this;

            // Launch file open picker and caller app is suspended and may be terminated if required
            openPicker.PickMultipleFilesAndContinue();
        }