当前位置: 首页>>代码示例>>C#>>正文


C# IMethodCallMessage.GetArgName方法代码示例

本文整理汇总了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());
			}
			
		}
开发者ID:dialectsoftware,项目名称:DialectSoftware.Composition,代码行数:8,代码来源:CompositionException.cs

示例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;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:SoapMessageSurrogate.cs

示例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]);
                }
            }
//.........这里部分代码省略.........
开发者ID:LiuXiaotian,项目名称:ProtocolTestFramework,代码行数:101,代码来源:RpcAdapterProxy.cs

示例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;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:15,代码来源:remotingsurrogateselector.cs


注:本文中的IMethodCallMessage.GetArgName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。