• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IMethodMessage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: CreateFromIMethodMessage

 public static MessageCall CreateFromIMethodMessage(IMethodMessage message)
 {
     return new MessageCall(message.MethodName, message.Args);
 }
开发者ID:trfiladelfo,项目名称:MicroFrameworkSDK-Mono,代码行数:4,代码来源:Engine+-+Original.cs


示例17: StoreUserPropertiesForMethodMessage

        [System.Security.SecurityCritical]  // auto-generated
        protected static int StoreUserPropertiesForMethodMessage( 
            IMethodMessage msg, 
            ref ArrayList argsToSerialize)
        { 
            IDictionary properties = msg.Properties;
            MessageDictionary dict = properties as MessageDictionary;
            if (dict != null)
            { 
                if (dict.HasUserData())
                { 
                    int co = 0; 
                    foreach (DictionaryEntry entry in dict.InternalDictionary)
                    { 
                        if (argsToSerialize == null)
                            argsToSerialize = new ArrayList();
                        argsToSerialize.Add(entry);
                        co++; 
                    }
 
                    return co; 
                }
                else 
                {
                    return 0;
                }
            } 
            else
            { 
                // < 

                int co = 0; 
                foreach (DictionaryEntry entry in properties)
                {
                    if (argsToSerialize == null)
                        argsToSerialize = new ArrayList(); 
                    argsToSerialize.Add(entry);
                    co++; 
                } 

                return co; 
            }
        } // StoreUserPropertiesForMethodMessage
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:43,代码来源:MessageSmuggler.cs


示例18: StoreUserPropertiesForMethodMessage

        [System.Security.SecurityCritical]  // auto-generated
        private static Object[] StoreUserPropertiesForMethodMessage(IMethodMessage msg)
        {
            ArrayList argsToSerialize = null;
            IDictionary properties = msg.Properties;

            if (properties == null)
                return null;

            MessageDictionary dict = properties as MessageDictionary;
            if (dict != null)
            {
                if (dict.HasUserData())
                {
                    int co = 0;
                    foreach (DictionaryEntry entry in dict.InternalDictionary)
                    {
                        if (argsToSerialize == null)
                            argsToSerialize = new ArrayList();
                        argsToSerialize.Add(entry);
                        co++;
                    }

                    return argsToSerialize.ToArray();
                }
                else
                {
                    return null;
                }
            }
            else
            {
                // <


                int co = 0;
                foreach (DictionaryEntry entry in properties)
                {
                    if (argsToSerialize == null)
                        argsToSerialize = new ArrayList();
                    argsToSerialize.Add(entry);
                    co++;
                }

                if (argsToSerialize != null)
                    return argsToSerialize.ToArray();
                else
                    return null;
            }

        } // StoreUserPropertiesForMethodMessage
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:51,代码来源:BinaryObjectWriter.cs


示例19: InternalGetMethodBaseFromMethodMessage

        [System.Security.SecurityCritical]  // auto-generated 
        internal static MethodBase InternalGetMethodBaseFromMethodMessage(IMethodMessage msg)
        { 
            if(null == msg)
            {
                return null;
            } 

            Type t = RemotingServices.InternalGetTypeFromQualifiedTypeName(msg.TypeName); 
            if (t == null) 
            {
                throw new RemotingException( 
                    String.Format(
                        CultureInfo.CurrentCulture, Environment.GetResourceString(
                            "Remoting_BadType"),
                        msg.TypeName)); 

            } 
 
            // Use the signature, type and method name to determine the
            // methodbase via reflection. 
            Type[] signature = (Type[])msg.MethodSignature;
            return GetMethodBase(msg, t, signature);
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:24,代码来源:RemotingServices.cs


示例20: CopyFrom

		internal void CopyFrom (IMethodMessage call)
		{
			_uri = call.Uri;
			_typeName = call.TypeName;
			_methodName = call.MethodName;
			_args = call.Args;
			_methodSignature = (Type[]) call.MethodSignature;
			_methodBase = call.MethodBase;
			_callContext = call.LogicalCallContext;
			Init();
		}
开发者ID:runefs,项目名称:Marvin,代码行数:11,代码来源:MethodCall.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IMethodReference类代码示例发布时间:2022-05-24
下一篇:
C# IMethodInvocation类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap