Ejemplo n.º 1
0
        public SequenceTabViewModel(BackgroundExecutionService backgroundService)
        {
            _backgroundService       = backgroundService;
            OpenMethodChooserCommand = new DelegateCommand(() => OpenMethodChooserAsync());

            EditFilterCommand = new DelegateCommand(ExecuteEditFilter);
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 public void RegisterBackgroundProcess <T>() where T : ICoreJob, new()
 {
     using (var service = new BackgroundExecutionService())
     {
         service.Start(new T());
     }
 }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 6
0
        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);
        }