本文整理汇总了C#中System.Runtime.Remoting.Messaging.IMethodReturnMessage.OutArgCount属性的典型用法代码示例。如果您正苦于以下问题:C# IMethodReturnMessage.OutArgCount属性的具体用法?C# IMethodReturnMessage.OutArgCount怎么用?C# IMethodReturnMessage.OutArgCount使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Runtime.Remoting.Messaging.IMethodReturnMessage
的用法示例。
在下文中一共展示了IMethodReturnMessage.OutArgCount属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Invoke
public override IMessage Invoke(IMessage myMessage)
{
IMethodCallMessage myCallMessage = (IMethodCallMessage)myMessage;
IMethodReturnMessage myIMethodReturnMessage =
RemotingServices.ExecuteMessage(myMarshalByRefObject, myCallMessage);
Console.WriteLine("Method name : " + myIMethodReturnMessage.MethodName);
Console.WriteLine("The return value is : " + myIMethodReturnMessage.ReturnValue);
// Get number of 'ref' and 'out' parameters.
int myArgOutCount = myIMethodReturnMessage.OutArgCount;
Console.WriteLine("The number of 'ref', 'out' parameters are : " +
myIMethodReturnMessage.OutArgCount);
// Gets name and values of 'ref' and 'out' parameters.
for(int i = 0; i < myArgOutCount; i++)
{
Console.WriteLine("Name of argument {0} is '{1}'.",
i, myIMethodReturnMessage.GetOutArgName(i));
Console.WriteLine("Value of argument {0} is '{1}'.",
i, myIMethodReturnMessage.GetOutArg(i));
}
Console.WriteLine();
object[] myObjectArray = myIMethodReturnMessage.OutArgs;
for(int i = 0; i < myObjectArray.Length; i++)
Console.WriteLine("Value of argument {0} is '{1}' in OutArgs",
i, myObjectArray[i]);
return myIMethodReturnMessage;
}