public DialogOpenedEventArgs(DialogSession session, RoutedEvent routedEvent)
        {
            if (session == null) throw new ArgumentNullException(nameof(session));

            Session = session;
            RoutedEvent = routedEvent;
        }
        public DialogClosingEventArgs(DialogSession session, object parameter)
        {
            if (session == null) throw new ArgumentNullException(nameof(session));
            Session = session;

            Parameter = parameter;         
        }
Пример #3
0
 private async Task <bool?> StartTask(DependencyObject view)
 {
     return(await DialogHost.Show(view, dialogIdentifier, (object sender, DialogOpenedEventArgs args) =>
     {
         sessionInstance = args.Session;
     }) as bool?);
 }
Пример #4
0
        public DialogOpenedEventArgs(DialogSession session, RoutedEvent routedEvent)
        {
            if (session == null)
            {
                throw new ArgumentNullException(nameof(session));
            }

            Session     = session;
            RoutedEvent = routedEvent;
        }
        public DialogClosingEventArgs(DialogSession session, object parameter)
        {
            if (session == null)
            {
                throw new ArgumentNullException(nameof(session));
            }
            Session = session;

            Parameter = parameter;
        }
        public DialogClosingEventArgs(DialogSession session, object parameter, RoutedEvent routedEvent, object source) : base(routedEvent, source)
        {
            if (session == null)
            {
                throw new ArgumentNullException(nameof(session));
            }
            Session = session;

            Parameter = parameter;
        }
Пример #7
0
        public DialogClosingEventArgs(DialogSession session, object parameter, RoutedEvent routedEvent) : base(routedEvent)
        {
            Session = session ?? throw new ArgumentNullException(nameof(session));

            Parameter = parameter;
        }
Пример #8
0
        private static void DeleteFiles(IEnumerable<Redistributables> redistributables, ProgressBar progressBar,
            DialogSession dialogSession)
        {
            Task.Factory.StartNew(() =>
            {
                var failures = new List<string>();

                foreach (var item in redistributables.Select((red, idx) => new {red, idx}))
                {
                    progressBar.Dispatcher.BeginInvoke(new Action(() => progressBar.Value = item.idx));
                    try
                    {
                        if (File.Exists(item.red.Path))
                            File.Delete(item.red.Path);
                    }
                    catch
                    {
                        failures.Add(item.red.Path);
                    }
                }

                if (failures.Count > 0)
                    progressBar.Dispatcher.BeginInvoke(new Action(() =>
                    {
                        var failuresDialog = new FailuresDialog {FailuresListBox = {ItemsSource = failures}};
                        dialogSession.UpdateContent(failuresDialog);
                    }));
                else
                    progressBar.Dispatcher.BeginInvoke(new Action(dialogSession.Close));
            });
        }
Пример #9
0
 public DialogClosingEventArgs(DialogSession session, object parameter, RoutedEvent routedEvent)
     : this(session, routedEvent)
 {
 }
Пример #10
0
 public DialogClosingEventArgs(DialogSession session, RoutedEvent routedEvent)
     : base(routedEvent)
     => Session = session ?? throw new ArgumentNullException(nameof(session));
Пример #11
0
 private async void StartCleaning(ProgressBar progressBar, DialogSession session)
 {
     var callback =
         new Progress<int>(
             i => { progressBar.Dispatcher.BeginInvoke(new Action(() => { progressBar.Value = i; })); });
     var result = await cleanerService.CleanAsync(currentResult, callback);
     if (result.Failures.Count > 0)
         await progressBar.Dispatcher.BeginInvoke(new Action(() =>
         {
             var failuresDialog = new FailuresDialog {FailuresListBox = {ItemsSource = result.Failures}};
             session.UpdateContent(failuresDialog);
         }));
     else
         await progressBar.Dispatcher.BeginInvoke(new Action(session.Close));
     CanRefresh = true;
     await RunRefresh();
 }
        public DialogClosingEventArgs(DialogSession session, object parameter, RoutedEvent routedEvent, object source) : base(routedEvent, source)
        {
            if (session == null) throw new ArgumentNullException(nameof(session));
            Session = session;

            Parameter = parameter;            
        }