Пример #1
0
 public static async Task <BootstrapServers> Instance()
 {
     if (_Instance == null)
     {
         _Instance = await Load();
     }
     return(_Instance);
 }
Пример #2
0
        private static async Task <BootstrapServers> Load()
        {
            BootstrapServers returnValue = null;

            try
            {
                byte[] downloadedData;
                using (WebClient webClient = new WebClient())
                {
                    downloadedData = await webClient.DownloadDataTaskAsync(ServerAddress);
                }

                string json = Encoding.UTF8.GetString(downloadedData);
                returnValue = JsonConvert.DeserializeObject <BootstrapServers>(json);
            }
            catch
            {
                returnValue = new BootstrapServers();
            }

            returnValue.Save();

            return(returnValue);
        }
Пример #3
0
        private async void SetupBootstrapServers()
        {
            BootstrapServers instance = await BootstrapServers.Instance();

            await instance.Install();
        }