本文整理汇总了C#中IMethodCallMessage.GetArgName方法的典型用法代码示例。如果您正苦于以下问题:C# IMethodCallMessage.GetArgName方法的具体用法?C# IMethodCallMessage.GetArgName怎么用?C# IMethodCallMessage.GetArgName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMethodCallMessage
的用法示例。
在下文中一共展示了IMethodCallMessage.GetArgName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompositionException
public CompositionException(IMethodCallMessage Message,string message, System.Exception innerException):this(String.Format("Exception:{0}\r\nAssembly:{1}\r\n{2}:{3}\r\nArgs:\r\n",message,Message.TypeName,Message.MethodBase.MemberType,Message.MethodName),innerException)
{
for(int i=0; i<Message.ArgCount; i+=2)
{
_message = String.Format("{0}\t{1}={2}\r\n",_message,Message.GetArgName(i),Message.GetArg(i).ToString());
}
}
示例2: GetNames
internal virtual string[] GetNames(IMethodCallMessage m, int c)
{
string[] strArray = new string[c];
for (int i = 0; i < c; i++)
{
string argName = m.GetArgName(i);
if (argName == null)
{
argName = "__param" + i;
}
strArray[i] = argName;
}
return strArray;
}
示例3: Invoke
protected override IMessage Invoke(IMethodCallMessage mcall)
{
Marshaler marshaler = new Marshaler(site, NativeMarshalingConfiguration.Configuration);
foreach (Type type in proxiedType.Assembly.GetTypes())
{
marshaler.DefineCustomType(type.Name, type);
}
if (mcall.MethodBase == getHandleMethod)
return GetHandle(mcall);
if (mcall.MethodBase == setHandleMethod)
return SetHandle(mcall);
Initialize();
RpcStub stub;
if (!stubs.TryGetValue(mcall.MethodBase, out stub))
throw new InvalidOperationException(String.Format("cannot find stub for method '{0}'", mcall.MethodBase));
// marshal parameters
int n = stub.parameters.Length;
int actualsOffs = handleImplicit ? 1 : 0;
object[] actuals = new object[n + actualsOffs];
if (handleImplicit)
{
if (handle == null)
marshaler.TestAssumeFail(
"handle undefined for rpc interface '{0}' with implicit handle passing",
proxiedType);
IntPtr ptr = Marshal.StringToHGlobalUni(handle);
marshaler.MarkMemoryForDispose(ptr);
actuals[0] = ptr;
}
marshaler.EnterContext();
for (int i = 0; i < n; i++)
{
if (!stub.parameters[i].IsOut)
{
marshaler.DefineSymbol(mcall.GetArgName(i), mcall.Args[i]);
}
}
ParameterInfo[] parameterInfos = mcall.MethodBase.GetParameters();
for (int pass = 0; pass < 2; pass++)
{
for (int i = 0; i < n; i++)
{
if (pass == 0 && stub.parameters[i].HasDynamicExpression)
{
continue;
}
if (pass == 1
&& !stub.parameters[i].HasDynamicExpression)
{
continue;
}
stub.parameters[i].AllocateMemoryRegion(marshaler, mcall.Args[i]);
RpcParameter rp = stub.parameters[i];
if (rp.marshallingRegion != null)
rp.marshallingRegion.TryReset();
if (!rp.IsOut
&& mcall.Args[i] != null)
{
object value = mcall.Args[i];
// Validate the value of the parameter.
if (this.needAutoValidate)
CheckParameter(parameterInfos[i], value, mcall, marshaler.SymbolStore);
marshaler.MarshalInto(rp.context, rp.marshallingRegion, mcall.Args[i]);
}
else
{
marshaler.EnterRegion(rp.marshallingRegion);
marshaler.Clear(marshaler.GetSize(rp.context, null));
marshaler.ExitRegion();
}
if (!rp.IsByRef)
{
actuals[i + actualsOffs] = rp.Get();
}
else
{
if (mcall.Args[i] == null && !rp.IsOut)
{
actuals[i + actualsOffs] = IntPtr.Zero;
}
else
{
actuals[i + actualsOffs] = rp.marshallingRegion.NativeMemory;
}
}
marshaler.DefineSymbol(mcall.GetArgName(i), actuals[i + actualsOffs]);
}
}
//.........这里部分代码省略.........
示例4: GetNames
[System.Security.SecurityCritical] // auto-generated
internal virtual String[] GetNames(IMethodCallMessage m, int c)
{
String[] names = new String[c];
for (int i = 0; i < c; i++)
{
String name = m.GetArgName(i);
if (name == null)
{
name = "__param" + i;
}
names[i] = name;
}
return names;
}