static async Task Main(string[] args) { Console.Write("Select role: "); var role = SelectRole(Console.ReadLine()); var speechReader = new SpeechReader(SpeechLoader.GetAll(), role); using (var rdfClient = new RdfClient(role, speechReader)) { rdfClient.IsEnd.WaitOne(); } }
public RdfClient(string name, SpeechReader reader) { _httpClient = new HttpClient(); Name = name; _reader = reader; NotificationHandler.Instance.Value.StartHandling(Guid.NewGuid()).Wait(); NotificationHandler.Instance.Value.NewMessageReceive += OnMessage; var speech = _reader.TrySayFirst(); if (speech is not null) { Say(speech.Content); } }