Esempio n. 1
0
 public GitStatusCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness)
     : base(settingAgent, "Status", new[] { "status" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
 }
Esempio n. 2
0
 public GitRebaseCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness)
     : base(settingAgent, "Rebase", new[] { "rebase" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
 }
Esempio n. 3
0
 public GitOpenCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, IQuestionAgent questionAgent, ITalkAgent talkAgent)
     : base(settingAgent, "Open", new[] { "open repo", "open repository" })
 {
     _repositoryBusiness = repositoryBusiness;
     _questionAgent      = questionAgent;
     _talkAgent          = talkAgent;
 }
Esempio n. 4
0
 public GitUnstageCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness)
     : base(settingAgent, "Unstage", new[] { "unstage", "remove", "soft reset", "reset soft" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
 }
Esempio n. 5
0
 public GitPullCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness, IQuestionAgent questionAgent)
     : base(settingAgent, "pull", new[] { "pull" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
     _questionAgent      = questionAgent;
 }
Esempio n. 6
0
 public GitCommitCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness, IQuestionAgent questionAgent)
     : base(settingAgent, "Commit", new[] { "commit", "stage and commit", "stage commit", "amend" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
     _questionAgent      = questionAgent;
 }
Esempio n. 7
0
 public GitStashPopCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness, IQuestionAgent questionAgent)
     : base(settingAgent, "Pop", new[] { "stash pop", "pop", "pop the stash", "pop stash" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
     _questionAgent      = questionAgent;
 }
Esempio n. 8
0
 public GitResetHardCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness, IQuestionAgent questionAgent)
     : base(settingAgent, "Reset", new[] { "reset hard", "hard reset" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
     _questionAgent      = questionAgent;
 }
Esempio n. 9
0
 public GitStashCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness, IQuestionAgent questionAgent)
     : base(settingAgent, "Stash", new[] { "stash", "stash save", "save stash", "save to stash" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
     _questionAgent      = questionAgent;
 }
Esempio n. 10
0
        public GitSelectCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent)
            : base(settingAgent, "Select", new string[] { })
        {
            _repositoryBusiness = repositoryBusiness;
            _talkAgent          = talkAgent;

            var repos = settingAgent.GetSettings <string>("Repositories");

            foreach (var repo in repos)
            {
                var rawPhrases = GetRawList();
                AddPhrases(repo.Key, rawPhrases.Select(x => x.Replace("{RepositoryName}", repo.Key)).ToArray());
            }

            repositoryBusiness.RepositoryAddedEvent += RepositoryBusiness_RepositoryAddedEvent;
        }
Esempio n. 11
0
 public GitRepoAgent(ITalkAgent talkAgent, IRepositoryBusines repositoryBusiness)
 {
     _talkAgent          = talkAgent;
     _repositoryBusiness = repositoryBusiness;
 }
Esempio n. 12
0
 public ChangeNameCommand(ISettingAgent settingAgent, ITalkAgent talkAgent)
     : base(settingAgent, "Change name", new[] { "change name" })
 {
     _talkAgent = talkAgent;
 }
Esempio n. 13
0
        public static async Task <string> GetSelectedPathAsync(IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, ISettingAgent settingAgent)
        {
            var gitRepoPath = repositoryBusiness.GetSelectedPath();

            if (string.IsNullOrEmpty(gitRepoPath))
            {
                var repos = settingAgent.GetSettings <string>("Repositories");
                if (!repos.Any())
                {
                    await talkAgent.SayAsync("You need to open a repository before you can ask for status.");
                }
                else
                {
                    await talkAgent.SayAsync("You need to select a repository before you can ask for status.");
                }
            }

            return(gitRepoPath);
        }
Esempio n. 14
0
 public GitListCommand(ISettingAgent settingAgent, ITalkAgent talkAgent)
     : base(settingAgent, "List", new[] { "list repos", "list repositories", "what repositories are there" })
 {
     _talkAgent = talkAgent;
 }
Esempio n. 15
0
 public AutoStartCommand(ISettingAgent settingAgent, IQuestionAgent questionAgent, ITalkAgent talkAgent)
     : base(settingAgent, "Autostart", new[] { "enable autostart", "disable autostart", "autostart on", "autostart off", "autostart" })
 {
     _questionAgent = questionAgent;
     _talkAgent     = talkAgent;
 }
Esempio n. 16
0
 public HelpCommand(ISettingAgent settingAgent, ITalkAgent talkAgent, ICommandAgent commandAgent)
     : base(settingAgent, "Help", new[] { "help" })
 {
     _talkAgent    = talkAgent;
     _commandAgent = commandAgent;
 }
Esempio n. 17
0
 public CloseCommand(ISettingAgent settingAgent, IQuestionAgent questionAgent, ITalkAgent talkAgent)
     : base(settingAgent, "Close", new[] { "close", "exit", "quit", "bye", "goodbye", "stop" })
 {
     _questionAgent = questionAgent;
     _talkAgent     = talkAgent;
 }
Esempio n. 18
0
 public QuestionAgent(ITalkAgent talkAgent, ISettingAgent settingAgent, IEventHub eventHub)
 {
     _talkAgent    = talkAgent;
     _settingAgent = settingAgent;
     _eventHub     = eventHub;
 }