public SequenceTabViewModel(BackgroundExecutionService backgroundService) { _backgroundService = backgroundService; OpenMethodChooserCommand = new DelegateCommand(() => OpenMethodChooserAsync()); EditFilterCommand = new DelegateCommand(ExecuteEditFilter); }
protected override void OnStartup(StartupEventArgs e) { //base.OnStartup(e); var outputDirectory = Environment.CurrentDirectory; var wnd = new MainWindow(); var service = new BackgroundExecutionService(wnd); _traceViewModel = new TracingViewModel(); _sequenceTabViewModel = new SequenceTabViewModel(service); _callGraphTabViewModel = new CallGraphTabViewModel(service); _traceViewModel.Target = Settings.Default.LastTarget; _traceViewModel.OutputDirectory = outputDirectory; _callGraphTabViewModel.WorkingDirectory = outputDirectory; _traceViewModel.AvailableTracesChanged += TraceViewModelOnAvailableTracesChanged; wnd._trace.DataContext = _traceViewModel; wnd._callgraphTab.DataContext = _callGraphTabViewModel; wnd._sequenceTab.DataContext = _sequenceTabViewModel; // Load initially available traces from the output directory UpdateAvailableTraces(); Current.MainWindow = wnd; wnd.Show(); }
public void RegisterBackgroundProcess <T>() where T : ICoreJob, new() { using (var service = new BackgroundExecutionService()) { service.Start(new T()); } }
public MethodChooserViewModel(BackgroundExecutionService backgroundService, string workingDirectory, IGenerator generator) { _backgroundService = backgroundService; _workingDirectory = workingDirectory; GenerateCommand = new DelegateCommand(async() => { await generator.ExecuteGenerate(StartFunction); var functionsInModel = generator.GetModelFunctions(); if (!functionsInModel.Any()) { foreach (var preFiltered in AllPreFilteredFunctions) { preFiltered.Hidden = false; } return; } foreach (var preFiltered in AllPreFilteredFunctions) { preFiltered.Hidden = !functionsInModel.Contains(preFiltered.Info); } }); SelectStartFunctionCommand = new DelegateCommand <FunctionInfoViewModel>(SelectStartFunction); SelectOnlyStartFunctionCommand = new DelegateCommand <FunctionInfoViewModel>(SelectOnlyStartFunction); IncludeCommand = new DelegateCommand <object>(Include); ExcludeCommand = new DelegateCommand <object>(Exclude); StartFunction = null; }
public void RegisterTimerBackgroundProcess <T>(int repeatMins) where T : ICoreJob, new() { using (var service = new BackgroundExecutionService()) { service.IntervalMinutes = repeatMins; service.Start(new T()); timers.Add(typeof(T).Name, service); } }
public static void OnBackgroundFetch(Action <UIBackgroundFetchResult> completionHandler) { var dict = GetAllSettings(); foreach (var obj in dict) { var details = obj.Data.Split(','); var invoker = (ICoreJob)Activator.CreateInstance(details[0], details[1]).Unwrap(); using (var service = new BackgroundExecutionService()) { service.Start(invoker); } } completionHandler(UIBackgroundFetchResult.NoData); }