Exemplo n.º 1
0
        static Exception HandleExternalExceptionInPartialTrust(Exception inner)
        {
            if (inner is COMException asCOMException)
            {
                var result = new WrapperCOMException(asCOMException.Message, asCOMException);
                SetMatroshika(inner);
                return(result);
            }

            if (inner is SEHException asSEHException)
            {
                var result = new WrapperSEHException(asSEHException.Message, asSEHException);
                SetMatroshika(inner);
                return(result);
            }

            if (inner is ExternalException asExternalException)
            {
                var result = new WrapperExternalException(asExternalException.Message, asExternalException);
                SetMatroshika(inner);
                return(result);
            }

            return(null);
        }
Exemplo n.º 2
0
        private static Exception HandleExternalExceptionInPartialTrust(Exception inner)
        {
            // Partial trust fallback.
            COMException      asCOMException;
            SEHException      asSEHException;
            ExternalException asExternalException;

            if ((asCOMException = inner as COMException) != null)
            {
                var result = new WrapperCOMException(asCOMException.Message, asCOMException);
                SetMatroshika(inner);
                return(result);
            }

            if ((asSEHException = inner as SEHException) != null)
            {
                var result = new WrapperSEHException(asSEHException.Message, asSEHException);
                SetMatroshika(inner);
                return(result);
            }

            if ((asExternalException = inner as ExternalException) != null)
            {
                var result = new WrapperExternalException(asExternalException.Message, asExternalException);
                SetMatroshika(inner);
                return(result);
            }

            return(null);
        }
Exemplo n.º 3
0
		private static Exception HandleExternalExceptionInPartialTrust( Exception inner )
		{
			// Partial trust fallback.
			COMException asCOMException;
			SEHException asSEHException;
			ExternalException asExternalException;

			if ( ( asCOMException = inner as COMException ) != null )
			{
				var result = new WrapperCOMException( asCOMException.Message, asCOMException );
				SetMatroshika( inner );
				return result;
			}

			if ( ( asSEHException = inner as SEHException ) != null )
			{
				var result = new WrapperSEHException( asSEHException.Message, asSEHException );
				SetMatroshika( inner );
				return result;
			}

			if ( ( asExternalException = inner as ExternalException ) != null )
			{
				var result = new WrapperExternalException( asExternalException.Message, asExternalException );
				SetMatroshika( inner );
				return result;
			}

			return null;
		}