internal RemoteHostCall(long callId, RemoteHostMethodId methodId, object[] parameters) { this._callId = callId; this._methodId = methodId; this._parameters = parameters; this._methodInfo = RemoteHostMethodInfo.LookUp(methodId); }
/// <summary> /// New remote host call failed exception. /// </summary> internal static Exception NewRemoteHostCallFailedException(RemoteHostMethodId methodId) { RemoteHostMethodInfo methodInfo = RemoteHostMethodInfo.LookUp(methodId); string resourceString = PSRemotingErrorInvariants.FormatResourceString( RemotingErrorIdStrings.RemoteHostCallFailed, methodInfo.Name); return(new PSRemotingDataStructureException(resourceString)); }
/// <summary> /// Constructor for RemoteHostCall. /// </summary> internal RemoteHostCall(long callId, RemoteHostMethodId methodId, object[] parameters) { Dbg.Assert(parameters != null, "Expected parameters != null"); _callId = callId; MethodId = methodId; Parameters = parameters; _methodInfo = RemoteHostMethodInfo.LookUp(methodId); }
internal static RemoteHostResponse Decode(PSObject data) { long propertyValue = RemotingDecoder.GetPropertyValue <long>(data, "ci"); RemoteHostMethodId methodId = RemotingDecoder.GetPropertyValue <RemoteHostMethodId>(data, "mi"); RemoteHostMethodInfo info = RemoteHostMethodInfo.LookUp(methodId); object returnValue = DecodeReturnValue(data, info.ReturnType); return(new RemoteHostResponse(propertyValue, methodId, returnValue, DecodeException(data))); }
internal static RemoteHostCall Decode(PSObject data) { long propertyValue1 = RemotingDecoder.GetPropertyValue <long>(data, "ci"); PSObject propertyValue2 = RemotingDecoder.GetPropertyValue <PSObject>(data, "mp"); RemoteHostMethodId propertyValue3 = RemotingDecoder.GetPropertyValue <RemoteHostMethodId>(data, "mi"); RemoteHostMethodInfo remoteHostMethodInfo = RemoteHostMethodInfo.LookUp(propertyValue3); object[] parameters = RemoteHostCall.DecodeParameters(propertyValue2, remoteHostMethodInfo.ParameterTypes); return(new RemoteHostCall(propertyValue1, propertyValue3, parameters)); }
internal static RemoteHostCall Decode(PSObject data) { long propertyValue = RemotingDecoder.GetPropertyValue <long>(data, "ci"); PSObject parametersPSObject = RemotingDecoder.GetPropertyValue <PSObject>(data, "mp"); RemoteHostMethodId methodId = RemotingDecoder.GetPropertyValue <RemoteHostMethodId>(data, "mi"); RemoteHostMethodInfo info = RemoteHostMethodInfo.LookUp(methodId); object[] objects = DecodeParameters(parametersPSObject, info.ParameterTypes); return(new RemoteHostCall(propertyValue, methodId, objects)); }
/// <summary> /// Decode. /// </summary> internal static RemoteHostResponse Decode(PSObject data) { Dbg.Assert(data != null, "Expected data != null"); // Extract all the fields from data. long callId = RemotingDecoder.GetPropertyValue <long>(data, RemoteDataNameStrings.CallId); RemoteHostMethodId methodId = RemotingDecoder.GetPropertyValue <RemoteHostMethodId>(data, RemoteDataNameStrings.MethodId); // Decode the return value and the exception. RemoteHostMethodInfo methodInfo = RemoteHostMethodInfo.LookUp(methodId); object returnValue = DecodeReturnValue(data, methodInfo.ReturnType); Exception exception = DecodeException(data); // Use these values to create a RemoteHostResponse and return it. return(new RemoteHostResponse(callId, methodId, returnValue, exception)); }
/// <summary> /// Decode. /// </summary> internal static RemoteHostCall Decode(PSObject data) { Dbg.Assert(data != null, "Expected data != null"); // Extract all the fields from data. long callId = RemotingDecoder.GetPropertyValue <long>(data, RemoteDataNameStrings.CallId); PSObject parametersPSObject = RemotingDecoder.GetPropertyValue <PSObject>(data, RemoteDataNameStrings.MethodParameters); RemoteHostMethodId methodId = RemotingDecoder.GetPropertyValue <RemoteHostMethodId>(data, RemoteDataNameStrings.MethodId); // Look up all the info related to the method. RemoteHostMethodInfo methodInfo = RemoteHostMethodInfo.LookUp(methodId); // Decode the parameters. object[] parameters = DecodeParameters(parametersPSObject, methodInfo.ParameterTypes); // Create and return the RemoteHostCall. return(new RemoteHostCall(callId, methodId, parameters)); }
internal static Exception NewRemoteHostCallFailedException(RemoteHostMethodId methodId) { RemoteHostMethodInfo info = RemoteHostMethodInfo.LookUp(methodId); return(new PSRemotingDataStructureException(PSRemotingErrorInvariants.FormatResourceString(RemotingErrorIdStrings.RemoteHostCallFailed, new object[] { info.Name }))); }