| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- //
- // System.Security.SecurityException.cs
- //
- // Author:
- // Nick Drochak([email protected])
- //
- // (C) Nick Drochak
- //
- using System.Runtime.Serialization;
- using System.Globalization;
- namespace System.Security {
- [Serializable]
- public class SecurityException : SystemException {
- // Fields
- string permissionState;
- Type permissionType;
- // Properties
- public string PermissionState
- {
- get { return permissionState; }
- }
- public Type PermissionType
- {
- get { return permissionType; }
- }
- // Constructors
- public SecurityException ()
- : base (Locale.GetText ("A security error has been detected."))
- {
- }
- public SecurityException (string message)
- : base (message)
- {
- }
-
- protected SecurityException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- permissionState = info.GetString ("permissionState");
- }
-
- public SecurityException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public SecurityException (string message, Type type)
- : base (message)
- {
- permissionType = type;
- }
-
- public SecurityException (string message, Type type, string state)
- : base (message)
- {
- permissionType = type;
- permissionState = state;
- }
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("PermissionState", permissionState);
- }
- public override string ToString ()
- {
- return permissionType.FullName + ": " + permissionState;
- }
- }
- }
|