예제 #1
0
        private async void ConnectAsync(Server server)
        {
            if (!await NetworkHelper.CheckConnectionAsync(server.Host))
            {
                MessageBox.Show("Servidor inacessivel", "Erro", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            try
            {
                var idrac = new StorageController(server);
                if (await idrac.CheckRedfishSupportAsync(StorageController.Controllers) == false)
                {
                    MessageBox.Show(string.Format("O servidor {0} não suporta a API Redfish", server), "Aviso", MessageBoxButton.OK, MessageBoxImage.Information);
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Falha ao conectar: {0}", ex.Message), "Aviso", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            var storageWindow = new StorageWindow(server)
            {
                Title = server.Host
            };

            storageWindow.Show();
        }