Hi Tom,
you could do that by using the customization facilities, like this:
public class WordLength : VSCustomizableNumBase<ushort>
{
protected override Int32 GetInt32()
{
return Convert.ToInt32(this.value * 2);
}
protected override void SetInt32(Int32 value)
{
this.value = (ushort)(value / 2);
}
}
[VSSerializableContainer]
public class MyContainer
{
[VSSerializableBinary(100, CounterMode = VSCounterMode.BytesStored, CounterMemberSpan = int.MaxValue)]
private WordLength dgLen = new WordLength();
[VSSerializableBinary(200)]
private int someData;
[VSSerializableBinary(300)]
private int someMoreData;
}