public QueryWorkspaceVm(string name, ICollection <string> assemblyFileNames) { DisplayName = name; _assemblyFileNames = assemblyFileNames; _executeQueryCommand = new IconCommandVm(Texts.Command_ExecuteQuery, Images.Command_ExecuteQuery.ToImageSource(), x => ExecuteQuery()); _abortQueryCommand = new IconCommandVm(Texts.Command_AbortQuery, Images.Command_CancelQuery.ToImageSource(), x => AbortQuery()); Commands.Add(_executeQueryCommand); _queryWorker = new BackgroundWorker { WorkerSupportsCancellation = true }; _queryWorker.DoWork += DoQuery; _queryWorker.RunWorkerCompleted += delegate { Commands.Add(_executeQueryCommand); Commands.Remove(_abortQueryCommand); }; Output = new QueryOutputVm(); Result = new QueryResultVm(); }
public StopwatchWriter(QueryOutputVm vm) { _vm = vm; _stopwatch = new Stopwatch(); _stopwatch.Start(); }