Exemplo n.º 1
0
        internal static RemoteHostResponse Decode(PSObject data)
        {
            long propertyValue1 = RemotingDecoder.GetPropertyValue <long>(data, "ci");
            RemoteHostMethodId   propertyValue2       = RemotingDecoder.GetPropertyValue <RemoteHostMethodId>(data, "mi");
            RemoteHostMethodInfo remoteHostMethodInfo = RemoteHostMethodInfo.LookUp(propertyValue2);
            object    returnValue = RemoteHostResponse.DecodeReturnValue(data, remoteHostMethodInfo.ReturnType);
            Exception exception   = RemoteHostResponse.DecodeException(data);

            return(new RemoteHostResponse(propertyValue1, propertyValue2, returnValue, exception));
        }
Exemplo n.º 2
0
 internal static Exception NewRemoteHostCallFailedException(RemoteHostMethodId methodId) => (Exception) new PSRemotingDataStructureException(PSRemotingErrorInvariants.FormatResourceString(PSRemotingErrorId.RemoteHostCallFailed, (object)RemoteHostMethodInfo.LookUp(methodId).Name));