예제 #1
0
        private void CheckExecuteReceiveAction(ReceivedMessage message, Type receivedObjectType, object receivedObject)
        {
            Delegate receiveAction = ReceiveHandle[receivedObjectType].ReceiveAction;

            if (receiveAction != null)
            {
                if (receiveAction.GetMethodInfo().GetParameters().Count() > 1)
                {
                    receiveAction.DynamicInvoke(message.From, receivedObject);
                }
                else
                {
                    receiveAction.DynamicInvoke(receivedObject);
                }
            }
        }
예제 #2
0
        private void CheckExecuteResponseHandle(ReceivedMessage message, Type receivedObjectType, string token, object receivedObject)
        {
            var responseType_ActionMatch = ResponseHandle[token].sentMessage.resonseType_to_actionMatch;

            if (responseType_ActionMatch.ContainsKey(receivedObjectType))
            {
                Delegate responseHandle = responseType_ActionMatch[receivedObjectType];
                if (responseHandle.GetMethodInfo().GetParameters().Count() > 1)
                {
                    responseHandle.DynamicInvoke(message.From, receivedObject);
                }
                else
                {
                    responseHandle.DynamicInvoke(receivedObject);
                }

                //Remove the client from the list of clients who still need to respond
                ResponseHandle[token].ClientsToRespond.Remove(message.From);
            }
        }