public override void ViewWillAppear() { base.ViewWillAppear(); if (_aggregator != null) { return; } _aggregator = TinyIoC.TinyIoCContainer.Current.Resolve <IRepositoryInformationAggregator>(); var actionProvider = TinyIoC.TinyIoCContainer.Current.Resolve <IRepositoryActionProvider>(); _monitor = TinyIoC.TinyIoCContainer.Current.Resolve <IRepositoryMonitor>(); _appSettingsService = TinyIoC.TinyIoCContainer.Current.Resolve <IAppSettingsService>(); _repositoryIgnoreStore = TinyIoC.TinyIoCContainer.Current.Resolve <IRepositoryIgnoreStore>(); // Do any additional setup after loading the view. var datasource = new RepositoryTableDataSource(_aggregator.Repositories); RepoTab.DataSource = datasource; datasource.CollectionChanged += Datasource_CollectionChanged; RepoTab.Delegate = new RepositoryTableDelegate(RepoTab, datasource, actionProvider); SetControlVisibilityByRepositoryAvailability(); RepoTab.BackgroundColor = NSColor.Clear; RepoTab.EnclosingScrollView.DrawsBackground = false; SearchBox.FinishInput += SearchBox_FinishInput; SearchBox.NextKeyView = RepoTab; }
public override void ViewWillAppear() { base.ViewWillAppear(); if (_aggregator != null) { return; } _aggregator = TinyIoC.TinyIoCContainer.Current.Resolve <IRepositoryInformationAggregator>(); var actionProvider = TinyIoC.TinyIoCContainer.Current.Resolve <IRepositoryActionProvider>(); _monitor = TinyIoC.TinyIoCContainer.Current.Resolve <IRepositoryMonitor>(); _monitor.OnScanStateChanged += _monitor_OnScanStateChanged; _stringCommandHandler.Define(new string[] { "help", "man", "?" }, ShowCommandReference, "Shows this help page"); _stringCommandHandler.Define(new string[] { "scan" }, async() => await _monitor.ScanForLocalRepositoriesAsync(), "Scans this Mac for git repositories"); _stringCommandHandler.Define(new string[] { "reset" }, _monitor.Reset, "Resets the repository cache"); _stringCommandHandler.Define(new string[] { "info", "stats" }, ShowStats, "Shows process informations"); _stringCommandHandler.Define(new string[] { "quit", "close", "exit" }, () => NSApplication.SharedApplication.Terminate(this), "Closes the application"); // Do any additional setup after loading the view. var datasource = new RepositoryTableDataSource(_aggregator.Repositories); RepoTab.DataSource = datasource; datasource.CollectionChanged += Datasource_CollectionChanged; RepoTab.Delegate = new RepositoryTableDelegate(RepoTab, datasource, actionProvider); SetControlVisibilityByRepositoryAvailability(); RepoTab.BackgroundColor = NSColor.Clear; RepoTab.EnclosingScrollView.DrawsBackground = false; SearchBox.FinishInput += SearchBox_FinishInput; SearchBox.NextKeyView = RepoTab; }