public MainVM(SettingsVM settings, ICollection <SourceDirectory> sourceDirectories) { Guard.NotNull(settings); _ts = TaskScheduler.FromCurrentSynchronizationContext(); HistoryVM = new HistoryVM(this); OutputVM = new OutputVM(this); SettingsVM = settings; WireupCommands(); if (sourceDirectories != null) { foreach (var src in sourceDirectories) { SourceDirectories.Add(new SourceDirectoryVM(this, src)); } } System.Windows.Data.BindingOperations.EnableCollectionSynchronization(SourceDirectories, SourceDirectories); ThemeHelper.ApplyTheme(SettingsVM.Theme); }
internal static OperationResult Bootstrap(CancellationToken cancellationToken, ProgressViewModel progress, string path, string stream, HistoryVM history) { if (string.IsNullOrEmpty(path) || !Directory.Exists(path) || string.IsNullOrEmpty(stream)) { return(OperationResult.Failed); } var shell = new CommandLineSandbox(path); var vm = history.CreateHistoryEvent(); vm.Command = "bentleybootstrap.py " + stream; vm.JobName = "Bootstrap"; vm.Stream = stream; vm.SrcDir = path; var context = new JobContext <BootstrapInfo>(shell, cancellationToken, progress, vm, history?.Parent?.OutputVM); return(Execute(context, ProcessBootstrapOutput)); }
public HistoryEventVM(HistoryVM parent) { Parent = parent; WireupCommands(); }