Пример #1
0
 /// <summary>
 /// Registers a message type identifier to refer to a type.
 /// </summary>
 /// <param name="messageType">The message type identifier</param>
 /// <param name="type">The type</param>
 public static void Register(MessageType messageType, Type type)
 {
     int hashCode = messageType.GetHashCode();
     if (g_messageTypes[hashCode] != null)
         throw new Exception("Two message types have the same identifier: " + type.Name + " and " + g_messageTypes[hashCode].Name);
     g_messageTypes[hashCode] = type;
 }
Пример #2
0
 public MessageTypeAttribute(byte topicIdentifier, bool isReply)
 {
     ToBeRegistered = true;
     Type = new MessageType(topicIdentifier, isReply);
 }