private static string DetermineExceptionContext(ESecurityAccessDeniedException AException, System.Type ATypeWhichRaisesError) { if (AException == null) { throw new ArgumentNullException("AException"); } if (AException.Context != String.Empty) { return AException.Context; } else if (ATypeWhichRaisesError != null) { return ATypeWhichRaisesError.Name; } else { return Catalog.GetString("Not specified"); } }
/// <summary> /// todoComment /// </summary> /// <param name="AException"></param> /// <param name="ATypeWhichRaisesError"></param> public static void MsgSecurityException(ESecurityAccessDeniedException AException, System.Type ATypeWhichRaisesError) { string Context = DetermineExceptionContext(AException, ATypeWhichRaisesError); MessageBox.Show(AException.Message + BuildMessageFooter(PetraErrorCodes.ERR_NOPERMISSIONTOACCESSMODULE, Context), Catalog.GetString("Security Violation"), MessageBoxButtons.OK, MessageBoxIcon.Information); }