private void dgvProducts_SelectionChanged(object sender, EventArgs e)
 {
     txtBxMessage.Text = String.Empty;
     if (dgvProducts.SelectedRows != null && dgvProducts.SelectedRows.Count == 1)
     {
         uint errorCode;
         if (uint.TryParse(dgvProducts.SelectedRows[0].Cells["ResultCode"].Value.ToString(), out errorCode))
         {
             txtBxMessage.Text = MsiProduct.GetErrorMessage(errorCode);
         }
     }
 }
        private void ReportUninstallResult(uint resultCode, DataGridViewRow row, MsiProduct uninstalledProduct)
        {
            row.Cells["ResultCode"].Value = resultCode;

            if (MsiProduct.IsSuccess(resultCode))
            {
                txtBxMessage.BackColor = Color.LightGreen;
                if (MsiProduct.IsRebootNeeded(resultCode))
                {
                    row.Cells["Result"].Value = _localization.GetLocalizedString("SuccessPendingReboot");
                    row.Cells["Result"].Style = _successRebootStyle;
                    txtBxMessage.Text         = _localization.GetLocalizedString("SuccessPendingReboot");
                    if (!UninstalledProducts.Contains(uninstalledProduct))
                    {
                        UninstalledProducts.Add(uninstalledProduct);
                    }
                }
                else
                {
                    row.Cells["Result"].Value = _localization.GetLocalizedString("Success");
                    row.Cells["Result"].Style = _successStyle;
                    txtBxMessage.Text         = _localization.GetLocalizedString("Success");
                    if (!UninstalledProducts.Contains(uninstalledProduct))
                    {
                        UninstalledProducts.Add(uninstalledProduct);
                    }
                }
            }
            else
            {
                txtBxMessage.BackColor    = Color.Orange;
                row.Cells["Result"].Value = _localization.GetLocalizedString("Failed") + "(" + resultCode + ")";
                row.Cells["Result"].Style = _failedStyle;
                txtBxMessage.Text         = MsiProduct.GetErrorMessage(resultCode);
            }
        }
Exemplo n.º 3
0
 private void DisplayResult(uint resultCode)
 {
     if (MsiProduct.IsSuccess(resultCode))
     {
         if (MsiProduct.IsRebootNeeded(resultCode))
         {
             txtBxResult.Text = _localization.GetLocalizedString("SuccessPendingReboot");
         }
         else
         {
             txtBxResult.Text = _localization.GetLocalizedString("Success");
         }
         txtBxResult.BackColor = Color.LightGreen;
     }
     else
     {
         txtBxResult.Text      = _localization.GetLocalizedString("Failed") + "(" + resultCode.ToString() + ") : " + MsiProduct.GetErrorMessage(resultCode);
         txtBxResult.BackColor = Color.Orange;
     }
     txtBxResult.Refresh();
 }