コード例 #1
0
        public static ExtendedParameter Load(IValueStream stream)
        {
            ExtendedParameter ret = null;
            Tags tag = (Tags)stream.EnterChoice();

            switch (tag)
            {
            case Tags.Null:
                ret = Value <NullWrapper> .Load(stream);

                break;

            case Tags.Real:
                ret = Value <RealWrapper> .Load(stream);

                break;

            case Tags.Integer:
                ret = Value <IntegerWrapper> .Load(stream);

                break;

            case Tags.Boolean:
                ret = Value <BooleanWrapper> .Load(stream);

                break;

            case Tags.Double:
                ret = Value <DoubleWrapper> .Load(stream);

                break;

            case Tags.Octet:
                ret = Value <OctetWrapper> .Load(stream);

                break;

            case Tags.Bitstring:
                ret = Value <BitstringWrapper> .Load(stream);

                break;

            case Tags.Enum:
                ret = Value <EnumWrapper> .Load(stream);

                break;

            case Tags.Reference:
                ret = Value <ReferenceWrapper> .Load(stream);

                break;

            default:
                throw new Exception();
            }
            stream.LeaveChoice();
            return(ret);
        }
コード例 #2
0
        public static void Save(IValueSink sink, ExtendedParameter value)
        {
            sink.EnterChoice((byte)value.Tag);
            switch (value.Tag)
            {
            case Tags.Null:
                Value <NullWrapper> .Save(sink, (NullWrapper)value);

                break;

            case Tags.Real:
                Value <RealWrapper> .Save(sink, (RealWrapper)value);

                break;

            case Tags.Integer:
                Value <IntegerWrapper> .Save(sink, (IntegerWrapper)value);

                break;

            case Tags.Boolean:
                Value <BooleanWrapper> .Save(sink, (BooleanWrapper)value);

                break;

            case Tags.Double:
                Value <DoubleWrapper> .Save(sink, (DoubleWrapper)value);

                break;

            case Tags.Octet:
                Value <OctetWrapper> .Save(sink, (OctetWrapper)value);

                break;

            case Tags.Bitstring:
                Value <BitstringWrapper> .Save(sink, (BitstringWrapper)value);

                break;

            case Tags.Enum:
                Value <EnumWrapper> .Save(sink, (EnumWrapper)value);

                break;

            case Tags.Reference:
                Value <ReferenceWrapper> .Save(sink, (ReferenceWrapper)value);

                break;

            default:
                throw new Exception();
            }
            sink.LeaveChoice();
        }
コード例 #3
0
ファイル: ExtendedParameter.cs プロジェクト: LorenVS/bacstack
 public static void Save(IValueSink sink, ExtendedParameter value)
 {
     sink.EnterChoice((byte)value.Tag);
     switch(value.Tag)
     {
         case Tags.Null:
             Value<NullWrapper>.Save(sink, (NullWrapper)value);
             break;
         case Tags.Real:
             Value<RealWrapper>.Save(sink, (RealWrapper)value);
             break;
         case Tags.Integer:
             Value<IntegerWrapper>.Save(sink, (IntegerWrapper)value);
             break;
         case Tags.Boolean:
             Value<BooleanWrapper>.Save(sink, (BooleanWrapper)value);
             break;
         case Tags.Double:
             Value<DoubleWrapper>.Save(sink, (DoubleWrapper)value);
             break;
         case Tags.Octet:
             Value<OctetWrapper>.Save(sink, (OctetWrapper)value);
             break;
         case Tags.Bitstring:
             Value<BitstringWrapper>.Save(sink, (BitstringWrapper)value);
             break;
         case Tags.Enum:
             Value<EnumWrapper>.Save(sink, (EnumWrapper)value);
             break;
         case Tags.Reference:
             Value<ReferenceWrapper>.Save(sink, (ReferenceWrapper)value);
             break;
         default:
             throw new Exception();
     }
     sink.LeaveChoice();
 }