コード例 #1
0
		public void DefineProperty(string name, int propertyType, int offset, int size)
		{
			var propertyDescription = new PropertyDescription(name, offset, size, propertyType);
			if (this.propertyIndex < this.messageDescription.Properties.Count)
			{
				var existingDesc = this.messageDescription.Properties[this.propertyIndex];
				if (existingDesc != propertyDescription)
				{
					throw new MessageRegistryException(propertyDescription, existingDesc);
				}
				++this.propertyIndex;
				return;
			}
			this.messageDescription.Properties.Add(propertyDescription);
			++this.propertyIndex;
			this.messageDescription.MinSize += propertyDescription.Size;
		}
コード例 #2
0
		public MessageRegistryException(PropertyDescription newDesc, PropertyDescription oldDesc)
			: base(string.Format("Mismatch description for property {0} / {1}", newDesc, oldDesc))
		{
		}