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; }
public GitStatusCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness) : base(settingAgent, "Status", new[] { "status" }) { _repositoryBusiness = repositoryBusiness; _talkAgent = talkAgent; _gitBusiness = gitBusiness; }
public GitOpenCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, IQuestionAgent questionAgent, ITalkAgent talkAgent) : base(settingAgent, "Open", new[] { "open repo", "open repository" }) { _repositoryBusiness = repositoryBusiness; _questionAgent = questionAgent; _talkAgent = talkAgent; }
public CommandAgent(IEventHub eventHub, ISettingAgent settingAgent) { _eventHub = eventHub; _commands = new List <IGitBitchCommand>(); _eventHub.StartTalkingEvent += EventHub_StartTalkingEvent; _eventHub.DoneTalkingEvent += EventHub_DoneTalkingEvent; _eventHub.StartListeningEvent += EventHub_StartListeningEvent; _eventHub.DoneListeningEvent += EventHub_DoneListeningEvent; _eventHub.StartWorkingEvent += EventHub_StartWorkingEvent; _eventHub.DoneWorkingEvent += EventHub_DoneWorkingEvent; _speechRecognitionEngine = new SpeechRecognitionEngine(); _speechRecognitionEngine.SpeechRecognized += SpeechRecognized; _speechRecognitionEngine.SpeechDetected += SpeechDetected; _speechRecognitionEngine.SpeechRecognitionRejected += SpeechRecognitionRejected; _speechRecognitionEngine.SpeechHypothesized += SpeechHypothesized; _speechRecognitionEngine.AudioStateChanged += AudioStateChanged; _speechRecognitionEngine.EmulateRecognizeCompleted += EmulateRecognizeCompleted; _speechRecognitionEngine.LoadGrammarCompleted += LoadGrammarCompleted; _speechRecognitionEngine.RecognizeCompleted += RecognizeCompleted; _speechRecognitionEngine.RecognizerUpdateReached += RecognizerUpdateReached; _speechRecognitionEngine.AudioLevelUpdated += AudioLevelUpdated; _speechRecognitionEngine.AudioSignalProblemOccurred += AudioSignalProblemOccurred; _eventHub.InvokeAudioInputStateChangedEvent(Source.CommandAgent, _voiceListenerWorking ? ListeningAudioState.NotListening : ListeningAudioState.MicrophoneMuted); }
public GitRebaseCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness) : base(settingAgent, "Rebase", new[] { "rebase" }) { _repositoryBusiness = repositoryBusiness; _talkAgent = talkAgent; _gitBusiness = gitBusiness; }
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; }
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; }
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; }
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; }
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; }
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; }
protected GitBitchCommand(ISettingAgent settingAgent, string name, string[] phrases = null) { _settingAgent = settingAgent; _name = name; var greetingName = settingAgent.GetSetting(Constants.Greeting, Constants.DefaultGreeting); var requireGreeting = settingAgent.GetSetting(Constants.RequireGreeting, false); _greeting = new Tuple <string, bool>(greetingName, requireGreeting); var bitchName = settingAgent.GetSetting(Constants.BitchName, Constants.DefaultBitchName); var requireBitchName = settingAgent.GetSetting(Constants.RequireBitchName, true); _bitchName = new Tuple <string, bool>(bitchName, requireBitchName); AddPhrases(string.Empty, phrases ?? new string[] { }); }
public QuestionAgent(ITalkAgent talkAgent, ISettingAgent settingAgent, IEventHub eventHub) { _talkAgent = talkAgent; _settingAgent = settingAgent; _eventHub = eventHub; }
public GitScanCommand(ISettingAgent settingAgent, IGitRepoAgent gitRepoAgent) : base(settingAgent, "Scan", new[] { "scan" }) { _gitRepoAgent = gitRepoAgent; }
public TalkAgent(ISettingAgent settingAgent, IEventHub eventHub) { _settingAgent = settingAgent; _eventHub = eventHub; }
public ChangeNameCommand(ISettingAgent settingAgent, ITalkAgent talkAgent) : base(settingAgent, "Change name", new[] { "change name" }) { _talkAgent = talkAgent; }
public CloseCommand(ISettingAgent settingAgent, IQuestionAgent questionAgent, ITalkAgent talkAgent) : base(settingAgent, "Close", new[] { "close", "exit", "quit", "bye", "goodbye", "stop" }) { _questionAgent = questionAgent; _talkAgent = talkAgent; }
public LockMachineCommand(ISettingAgent settingAgent) : base(settingAgent, "Lock", new[] { "lock machine" }) { }
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; }
public GenericCommand(ISettingAgent settingAgent, string name, string[] phrases, Action action) : base(settingAgent, name, phrases) { _action = action; }
public GitListCommand(ISettingAgent settingAgent, ITalkAgent talkAgent) : base(settingAgent, "List", new[] { "list repos", "list repositories", "what repositories are there" }) { _talkAgent = talkAgent; }
public HelpCommand(ISettingAgent settingAgent, ITalkAgent talkAgent, ICommandAgent commandAgent) : base(settingAgent, "Help", new[] { "help" }) { _talkAgent = talkAgent; _commandAgent = commandAgent; }
public RepositoryBusines(IDataRepository dataRepository, ISettingAgent settingAgent) { _dataRepository = dataRepository; _settingAgent = settingAgent; _selectedRepositoryName = _settingAgent.GetSetting <string>("LastSelected", null); }
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); }