Beispiel #1
0
		public IMessageDescription DefineMessage(int messageId, int parentMessageId = 0)
		{
			MessageDescription v;
			if (this.map.TryGetValue(messageId, out v))
			{
				if (v.ParentId != parentMessageId)
				{
					throw new ArgumentException("Different parent message");
				}
				return new WritableMessageDescription(v, this.GetParentMessage(parentMessageId));
			}
			v = new MessageDescription { MessageId = messageId, ParentId = parentMessageId };
			this.map.Add(messageId, v);
			v.ReadOnlyDescription = null;
			return new WritableMessageDescription(v, this.GetParentMessage(parentMessageId));
		}
		public WritableMessageDescription(MessageDescription messageDescription, IMessageDescription parentMessage)
		{
			this.messageDescription = messageDescription;
			this.parentMessage = parentMessage;
		}
		public ReadOnlyMessageDescription(MessageDescription messageDescription)
		{
			this.messageDescription = messageDescription;
		}