Ejemplo n.º 1
0
 protected virtual void OnFileRemoved(FileRemovedEventArgs e)
 {
     if (FileRemoved != null)
     {
         FileRemoved(this, e);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles the FileRemoved event of the fileList control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Backround_Cycler.EventArguments.FileRemovedEventArgs"/> instance containing the event data.</param>
        void fileList_FileRemoved(object sender, FileRemovedEventArgs e)
        {
            // ListViewItem[] foundItems = ltvFiles.Items.Find ( e.FilePath, true );
            ListViewItem foundItems = ltvFiles.FindItemWithText(e.FilePath, true, 0);

            if (foundItems != null)
            {
                foundItems.Remove();
            }
            // ltvFiles.Items.RemoveByKey ( e.FilePath );
        }
Ejemplo n.º 3
0
 private async void OnFileRemoved(FileOpenPickerUI sender, FileRemovedEventArgs args)
 {
     if (args.Id == id)
     {
         await dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
         {
             await new Windows.UI.Popups.MessageDialog("File removed from the basket.").ShowAsync();
             UpdateButtonState(false);
         });
     }
 }
 private async void OnFileRemoved(FileOpenPickerUI sender, FileRemovedEventArgs args)
 {
     // make sure that the item got removed matches the one we added.
     if (args.Id == id)
     {
         // The event handler may be invoked on a background thread, so use the Dispatcher to run the UI-related code on the UI thread.
         await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
         {
             OutputTextBlock.Text = Status.FileRemoved;
             UpdateButtonState(false);
         });
     }
 }
 /// <summary>
 /// Invoked when user removes one of the items from the Picker basket
 /// </summary>
 /// <param name="sender">The FileOpenPickerUI instance used to contain the available files.</param>
 /// <param name="e">Event data that describes the file removed.</param>
 private async void HandleFilePickerUIFileRemoved(FileOpenPickerUI sender,
                                                  FileRemovedEventArgs e)
 {
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         // Synchronize the select items in the UI lists to remove
         // the item that was removed from the picker's 'basket'
         var removedSelectedGridItem =
             FileGridView.SelectedItems.Cast <FileInfo>()
             .FirstOrDefault(x => x.Title == e.Id);
         if (removedSelectedGridItem != null)
         {
             FileGridView.SelectedItems.Remove(removedSelectedGridItem);
         }
     });
 }
 void fileOpenPickerUI_FileRemoved(FileOpenPickerUI sender, FileRemovedEventArgs args)
 {
     this.fileOpenPickerUI.RemoveFile(args.Id);
 }
Ejemplo n.º 7
0
        //public async void ActivateFilePicker(FileOpenPickerActivatedEventArgs e)
        //{
        //    this.fileOpenPickerUI = e.FileOpenPickerUI;
        //    this.fileOpenPickerUI.FileRemoved += this.fileOpenPickerUI_FileRemoved;

        //    Window.Current.Content = this;
        //    Window.Current.Activate();

        //    this.ViewModel.FileSelectionMode = ListViewSelectionMode.Extended;
        //    this.ViewModel.AreFilesClickable = false;
        //    await this.ViewModel.LoadPageAsync(null);
        //}

        void fileOpenPickerUI_FileRemoved(FileOpenPickerUI sender, FileRemovedEventArgs args)
        {
            throw new NotImplementedException();
        }
        /// <summary>
        /// Invoked when user removes one of the items from the Picker basket
        /// </summary>
        /// <param name="sender">The FileOpenPickerUI instance used to contain the available files.</param>
        /// <param name="e">Event data that describes the file removed.</param>
        private void FilePickerUI_FileRemoved(FileOpenPickerUI sender, FileRemovedEventArgs e)
        {
            throw new InvalidOperationException("Only single selection is currently supported.");

            // TODO: Respond to an item being deselected in the picker UI.
        }
Ejemplo n.º 9
0
 private void FileWatch_Removed(object sender, FileRemovedEventArgs e)
 {
     this.RemoveFile(e.FullPath);
 }