コード例 #1
0
        /// <summary>
        /// Tries to get the message type number for an ETP message.
        /// </summary>
        /// <param name="messageBodyType">The message body type to get the protocol for.</param>
        /// <returns>The message type number on success; -1 otherwise.</returns>
        public static int TryGetMessageTypeNumber(Type messageBodyType)
        {
            int messageType;
            if (MessageTypeByMessage.TryGetValue(messageBodyType, out messageType))
                return messageType;

            return -1;
        }
コード例 #2
0
ファイル: MessageReflection.cs プロジェクト: lanicon/etp.net
        /// <summary>
        /// Tries to get the message type number for an ETP message.
        /// </summary>
        /// <param name="messageBodyType">The message body type to get the protocol for.</param>
        /// <returns>The message type number on success; -1 otherwise.</returns>
        public static int TryGetMessageTypeNumber(Type messageBodyType)
        {
            int messageType;

            if (MessageTypeByMessage.TryGetValue(messageBodyType, out messageType))
            {
                return(messageType);
            }

            return(-1);
        }