Пример #1
0
 public ForEachWork()
 {
     Options = new WorkOptions
     {
         MaximumThreads = int.MaxValue
     };
 }
Пример #2
0
 public AsyncViewModelUpdate()
 {
     Options = new WorkOptions
     {
         MaximumThreads = int.MaxValue
     };
     _offset = 0;
 }
Пример #3
0
        public async Task AddOption(Option addOption)
        {
            try
            {
                if (Repair.Options != null)
                {
                    var s = WorkOptions.SelectMany(o => o.Options).ToList();
                    foreach (var option in Repair.Options.Where(x => WorkOptions.SelectMany(o => o.Options).Contains(x)).ToList())
                    //foreach (var option in Repair.Options.Where(x => CurrentWorkOption.Options.Contains(x)))
                    {
                        Repair.Options.Remove(option);
                    }
                }

                Repair.Options.Add(addOption);

                OnPropertyChanged("Repair");

                foreach (var option in WorkOptions.SelectMany(o => o.Options).ToList())
                {
                    if (option != addOption)
                    {
                        option.OptionView.IsSelected = false;
                    }
                    else
                    {
                        option.OptionView.IsSelected = true;
                    }
                }

                // var s = CurrentWorkOption.Options.Where(x => x == addOption).FirstOrDefault();

                // s.OptionView.IsSelected = true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Пример #4
0
        async Task ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            ErrorVisible = false;

            try
            {
                await Task.Delay(200);

                WorkOptions = await WorkOptionData.GetItemsAsync(Work.Id);

                if (WorkOptions.Count() != 0)
                {
                    AdWorkButton = true;
                }
                else
                {
                    AdWorkButton = false;
                }

                IsBusy = false;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                IsBusy       = false;
                Content      = false;
                ErrorVisible = true;
            }
        }
Пример #5
0
 Task IMyParallelTask.Start(Action action, WorkOptions options)
 {
     return(Parallel.Start(action, options));
 }
Пример #6
0
 Task IMyParallelTask.Start(Action action, WorkOptions options, Action completionCallback)
 {
     return(Parallel.Start(action, options, completionCallback));
 }