static void DumpTemplate(string[] names) { var task = GitignoreIoRepository.GetTemplate(names); if (task.Wait(5000)) { Console.WriteLine(task.Result); } }
static void DumpTemplateNames() { var task = GitignoreIoRepository.GetTemplateNames();//.ConfigureAwait(false).GetAwaiter(); if (task.Wait(5000)) { foreach (var templateName in task.Result) { Console.WriteLine(templateName); } } }
static ListView CreateListView() { var listView = new ListView { X = 0, Y = 0, Width = Dim.Fill(), Height = Dim.Fill(), AllowsMarking = true, AllowsMultipleSelection = true, }; async void OnListViewOnInitialized(object sender, EventArgs args) { _templates = (await GitignoreIoRepository.GetTemplateNames()).ToList(); await _listView.SetSourceAsync(_templates); } listView.Initialized += OnListViewOnInitialized; return(listView); }