Exemplo n.º 1
0
        /// <summary>
        /// Decode exception.
        /// </summary>
        private static Exception DecodeException(PSObject psObject)
        {
            object result = RemoteHostEncoder.DecodePropertyValue(psObject, RemoteDataNameStrings.MethodException, typeof(Exception));

            if (result == null)
            {
                return(null);
            }
            if (result is Exception)
            {
                return((Exception)result);
            }
            throw RemoteHostExceptions.NewDecodingFailedException();
        }
Exemplo n.º 2
0
        private static Exception DecodeException(PSObject psObject)
        {
            object obj2 = RemoteHostEncoder.DecodePropertyValue(psObject, "me", typeof(Exception));

            if (obj2 == null)
            {
                return(null);
            }
            if (!(obj2 is Exception))
            {
                throw RemoteHostExceptions.NewDecodingFailedException();
            }
            return((Exception)obj2);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Decode return value.
        /// </summary>
        private static object DecodeReturnValue(PSObject psObject, Type returnType)
        {
            object returnValue = RemoteHostEncoder.DecodePropertyValue(psObject, RemoteDataNameStrings.MethodReturnValue, returnType);

            return(returnValue);
        }
Exemplo n.º 4
0
 private static object DecodeReturnValue(PSObject psObject, Type returnType)
 {
     return(RemoteHostEncoder.DecodePropertyValue(psObject, "mr", returnType));
 }