예제 #1
0
        private async void Deploy_Click(object sender, RoutedEventArgs e)
        {
            bool isUploadButtonChecked = this.UploadButton.IsEnabled;

            Cursor = System.Windows.Input.Cursors.Wait;
            this.SelectButton.IsEnabled = false;
            this.UploadButton.IsEnabled = false;
            this.DeployButton.IsEnabled = false;
            this.CloseButton.IsEnabled  = false;
            try
            {
                ModelManager     modelManager = ModelManager.GetInstance();
                DeviceGroupModel dev          = deployWindow.SelectDeviceGroupModel;
                string           req          = ImageIdList.Text;

                if (await modelManager.Deployment(deployWindow.CurrentTenantModel, dev, req))
                {
                    MessageBox.Show("Deployment is success.",
                                    "Ok", MessageBoxButtons.OK);
                }
                else
                {
                    MessageBox.Show("Deployment is failure.",
                                    "Error", MessageBoxButtons.OK);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }

            Cursor = null;
            this.SelectButton.IsEnabled = true;
            this.UploadButton.IsEnabled = isUploadButtonChecked;
            this.DeployButton.IsEnabled = true;
            this.CloseButton.IsEnabled  = true;
        }