public static TestType Load(IValueStream stream)
            {
                stream.EnterSequence();
                var nullValue     = stream.GetNull();
                var booleanValue  = stream.GetBoolean();
                var optionalValue = Value <Option <byte> > .Loader(stream);

                var         choice      = stream.EnterChoice();
                ITestChoice choiceValue = null;

                switch (choice)
                {
                case 0:
                    choiceValue = FloatChoice.Load(stream);
                    break;

                case 1:
                    choiceValue = DoubleChoice.Load(stream);
                    break;

                case 2:
                    choiceValue = StringChoice.Load(stream);
                    break;
                }
                stream.LeaveChoice();

                var arrayValue = ReadOnlyArray <ushort> .Load(stream);

                return(new TestType(nullValue, booleanValue, optionalValue, choiceValue, arrayValue));
            }
 public TestType(Null nullValue, bool booleanValue, Option <byte> optionalValue, ITestChoice choiceValue, ReadOnlyArray <ushort> arrayValue)
 {
     this.NullValue     = nullValue;
     this.BooleanValue  = booleanValue;
     this.OptionalValue = optionalValue;
     this.ChoiceValue   = choiceValue;
     this.ArrayValue    = arrayValue;
 }
Example #3
0
 public TestType(Null nullValue, bool booleanValue, Option<byte> optionalValue, ITestChoice choiceValue, ReadOnlyArray<ushort> arrayValue)
 {
     this.NullValue = nullValue;
     this.BooleanValue = booleanValue;
     this.OptionalValue = optionalValue;
     this.ChoiceValue = choiceValue;
     this.ArrayValue = arrayValue;
 }