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


C# IMethodMessage类代码示例

本文整理汇总了C#中IMethodMessage的典型用法代码示例。如果您正苦于以下问题:C# IMethodMessage类的具体用法?C# IMethodMessage怎么用?C# IMethodMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IMethodMessage类属于命名空间,在下文中一共展示了IMethodMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsGetHashCodeMethod

 private static bool IsGetHashCodeMethod(IMethodMessage mcm)
 {
     if (mcm.MethodName != "GetHashCode") return false;
     Type[] argTypes = mcm.MethodSignature as Type[];
     if (argTypes == null) return false;
     return (argTypes.Length == 0);
 }
开发者ID:bcraytor,项目名称:rhino-mocks,代码行数:7,代码来源:RemotingProxy.cs

示例2: TryRaisePropertyChanged

        private void TryRaisePropertyChanged(IMethodMessage methodMessage)
        {
            if (methodMessage.MethodName.StartsWith("set_"))
            {
                var propertyName = methodMessage.MethodName.Substring(4);
                var type = Type.GetType(methodMessage.TypeName);
                var pi = type.GetProperty(propertyName);

                // check that we have the attribute defined
                if (Attribute.GetCustomAttribute(pi, typeof(NotifyAttribute)) != null)
                {
                    // get the field storing the delegate list that are stored by the event.
                    FieldInfo info = type.GetFields(BindingFlags.Instance | BindingFlags.NonPublic)
                        .Where(f => f.FieldType == typeof(PropertyChangedEventHandler))
                        .FirstOrDefault();

                    if (info != null)
                    {
                        // get the value of the field
                        var handler = info.GetValue(_target) as PropertyChangedEventHandler;

                        // invoke the delegate if it's not null (aka empty)
                        if (handler != null)
                            handler.Invoke(_target, new PropertyChangedEventArgs(propertyName));
                    }
                }
            }
        }
开发者ID:cstrahan,项目名称:adventures-in-dotnet,代码行数:28,代码来源:AutoNotifySink.cs

示例3: ProcessEventParameters

        private static bool ProcessEventParameters(WorkflowParameterBindingCollection parameters, IMethodMessage message, Type interfaceType, string operation)
        {
            bool isKnownSignature = false;
            if (parameters == null)
                return isKnownSignature;

            EventInfo eventInfo = interfaceType.GetEvent(operation);
            MethodInfo methodInfo = eventInfo.EventHandlerType.GetMethod("Invoke");
            int index = 0;

            foreach (ParameterInfo formalParameter in methodInfo.GetParameters())
            {
                if ((typeof(ExternalDataEventArgs).IsAssignableFrom(formalParameter.ParameterType)))
                {
                    if (index == 1)
                        isKnownSignature = true;
                }

                if (parameters.Contains(formalParameter.Name))
                {
                    WorkflowParameterBinding binding = parameters[formalParameter.Name];
                    binding.Value = message.Args[index];
                }
                index++;
            }
            return isKnownSignature;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:27,代码来源:InboundActivityHelper.cs

示例4: GetMethodName

        public static string GetMethodName(IMethodMessage methodMessage)
        {
            string methodName = methodMessage.MethodName;
            switch (methodName)
            {
                case ".ctor":
                    {
                        return "Constructor";
                    }
                case "FieldGetter":
                case "FieldSetter":
                    {
                        IMethodCallMessage methodCallMessage = (IMethodCallMessage)methodMessage;
                        return (string)methodCallMessage.InArgs[1];
                    }
            }
            if (methodName.EndsWith("Item"))
            {
                return methodName;
            }

            if (methodName.StartsWith("get_") || methodName.StartsWith("set_"))
            {
                return methodName.Substring(4);
            }
            if (methodName.StartsWith("add_"))
            {
                return methodName.Substring(4) + "+=";
            }
            if (methodName.StartsWith("remove_"))
            {
                return methodName.Substring(7) + "-=";
            }
            return methodName;
        }
开发者ID:liaoyu45,项目名称:LYCodes,代码行数:35,代码来源:MethodMessageUtil.cs

示例5: IsEqualsMethod

 private static bool IsEqualsMethod(IMethodMessage mcm)
 {
     if (mcm.MethodName != "Equals") return false;
     Type[] argTypes = mcm.MethodSignature as Type[];
     if (argTypes == null) return false;
     if (argTypes.Length == 1 && argTypes[0] == typeof(object)) return true;
     return false;
 }
开发者ID:bcraytor,项目名称:rhino-mocks,代码行数:8,代码来源:RemotingProxy.cs

示例6: OnBegin

 /// <summary>
 /// 开始事务
 /// </summary>
 /// <param name="attributes"></param>
 /// <param name="message"></param>
 private static void OnBegin(IEnumerable<object> attributes, IMethodMessage message)
 {
     foreach (var attr in attributes)
     {
         if (attr.GetType() == typeof(TransactionAttribute))
         {
             var tran = attr as TransactionAttribute;
             if (tran != null) tran.OnBegin();
         }
     }
 }
开发者ID:flxc11,项目名称:TerminalMS,代码行数:16,代码来源:AspectProxy.cs

示例7: ArgMapper

 internal ArgMapper(IMethodMessage mm, bool fOut)
 {
     this._mm = mm;
     MethodBase methodBase = this._mm.MethodBase;
     this._methodCachedData = InternalRemotingServices.GetReflectionCachedData(methodBase);
     if (fOut)
     {
         this._map = this._methodCachedData.MarshalResponseArgMap;
     }
     else
     {
         this._map = this._methodCachedData.MarshalRequestArgMap;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:ArgMapper.cs

示例8: CreateRequest

        RequestMessage CreateRequest(IMethodMessage methodCall)
        {
            var activityId = Guid.NewGuid();

            var method = ((MethodInfo) methodCall.MethodBase);
            var request = new RequestMessage
            {
                Id = contractType.Name + "::" + method.Name + "[" + Interlocked.Increment(ref callId) + "] / " + activityId,
                ActivityId = activityId,
                Destination = endPoint,
                MethodName = method.Name,
                ServiceName = contractType.Name,
                Params = methodCall.Args
            };
            return request;
        }
开发者ID:ruslander,项目名称:Halibut,代码行数:16,代码来源:HalibutProxy.cs

示例9: ProcessEventParameters

 private static bool ProcessEventParameters(WorkflowParameterBindingCollection parameters, IMethodMessage message, Type interfaceType, string operation)
 {
     bool flag = false;
     if (parameters != null)
     {
         MethodInfo method = interfaceType.GetEvent(operation).EventHandlerType.GetMethod("Invoke");
         int index = 0;
         foreach (ParameterInfo info3 in method.GetParameters())
         {
             if (typeof(ExternalDataEventArgs).IsAssignableFrom(info3.ParameterType) && (index == 1))
             {
                 flag = true;
             }
             if (parameters.Contains(info3.Name))
             {
                 WorkflowParameterBinding binding = parameters[info3.Name];
                 binding.Value = message.Args[index];
             }
             index++;
         }
     }
     return flag;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:23,代码来源:InboundActivityHelper.cs

示例10: CADMessageBase

		public CADMessageBase (IMethodMessage msg) {
			CADMethodRef methodRef = new CADMethodRef (msg);
			serializedMethod = CADSerializer.SerializeObject (methodRef).GetBuffer ();
		}
开发者ID:Profit0004,项目名称:mono,代码行数:4,代码来源:CADMessages.cs

示例11: SaveLogicalCallContext

		protected void SaveLogicalCallContext (IMethodMessage msg, ref ArrayList serializeList)
		{
			if (msg.LogicalCallContext != null && msg.LogicalCallContext.HasInfo) 
			{
				if (serializeList == null)
					serializeList = new ArrayList();

				_callContext = new CADArgHolder (serializeList.Count);
				serializeList.Add (msg.LogicalCallContext);
			}
		}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:CADMessages.cs

示例12: GetMethodBase

        [System.Security.SecurityCritical]  // auto-generated
        private static MethodBase GetMethodBase(IMethodMessage msg) 
        {
            MethodBase mb = msg.MethodBase; 
            if(null == mb) 
            {
                BCLDebug.Trace("REMOTE", "Method missing w/name ", msg.MethodName); 
                    throw new RemotingException(
                        String.Format(
                            CultureInfo.CurrentCulture, Environment.GetResourceString(
                                "Remoting_Message_MethodMissing"), 
                            msg.MethodName,
                            msg.TypeName)); 
            } 

            return mb; 
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:17,代码来源:StackBuilderSink.cs

示例13: GetSessionIdForMethodMessage

 [System.Security.SecurityCritical]  // auto-generated_required
 public static String GetSessionIdForMethodMessage(IMethodMessage msg)
 {
     return msg.Uri; 
 } // GetSessionIdForMessage
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:5,代码来源:RemotingServices.cs

示例14: IsMethodOverloaded

        [System.Security.SecurityCritical]  // auto-generated_required
        public static bool IsMethodOverloaded(IMethodMessage msg) 
        { 
            RemotingMethodCachedData cache =
                InternalRemotingServices.GetReflectionCachedData(msg.MethodBase); 

            return cache.IsOverloaded();
        } // IsMethodOverloaded
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:8,代码来源:RemotingServices.cs

示例15: GetMethodBaseFromMethodMessage

 [System.Security.SecurityCritical]  // auto-generated_required 
 public static MethodBase GetMethodBaseFromMethodMessage(IMethodMessage msg)
 {
     MethodBase mb = InternalGetMethodBaseFromMethodMessage(msg);
     return mb; 
 }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:6,代码来源:RemotingServices.cs


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