public RepositoryStatusBarVM(MainVM mainVM)
 {
     _mainVM = mainVM;
     SelectDirectoryCommand = new Action(SelectDirectory);
     Checkout = new Action <string>((branchName) => _mainVM.ConsoleControlVM.ExecuteCommand($"{GIT_CHECKOUT} {branchName}"));
     ReactiveAction branchNamesUpdater = new ReactiveAction(() => App.Current.Dispatcher.Invoke(UpdateBranchNames), _mainVM.Repo, _mainVM.RepoNotifier);
 }
Esempio n. 2
0
        public DiffViewerVM(MainVM mainVM)
        {
            _mainVM = mainVM;

            // If the diff viewer's currently selected file gets changed, the diff viewer needs to be refreshed.
            // Since the diff viewer is not currently watching its file for changes, I will just refresh it on any repository changes.
            ReactiveAction itemUpdater = new ReactiveAction(() => Application.Current.Dispatcher.Invoke(RefreshDiffViewer), _mainVM.RepoNotifier, _mainVM.Repo);
        }
Esempio n. 3
0
        public FileStatusVM(MainVM mainVM)
        {
            _mainVM = mainVM;

            Stage   = new Action <string>((path) => _mainVM.ConsoleControlVM.ExecuteCommand($"{GIT_ADD} {path}"));
            Unstage = new Action <string>((path) => _mainVM.ConsoleControlVM.ExecuteCommand($"{GIT_RESET_HEAD} {path}"));

            // Call UpdateItems on the dispatcher to avoid threading issues.
            ReactiveAction itemUpdater = new ReactiveAction(() => Application.Current.Dispatcher.Invoke(UpdateItems), _mainVM.RepoNotifier, _mainVM.Repo);
        }
Esempio n. 4
0
 public CommandButtonVM(MainVM mainVM)
 {
     _mainVM = mainVM;
     CreateCommands();
     ReactiveAction hotKeySetter = new ReactiveAction(RegisterHotKeys, HotKeyHelper);
 }