예제 #1
0
        /// <summary>
        /// Decodes on object using the supplied decoder.
        /// </summary>
        /// <param name="decoder">The decoder used to deserialize the object.</param>
        /// <returns>
        /// The deserialized object. Note: this is not necessarily the current instance.
        /// </returns>
        /// <exception cref="System.NotImplementedException"></exception>
        ApiException <TError> IEncodable <ApiException <TError> > .Decode(IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.ErrorResponse = obj.GetFieldObject <TError>("error");
            }

            return(this);
        }
예제 #2
0
        public void Decode(IDecoder decoder)
        {
            this.name   = decoder.GetString();
            this.age    = decoder.GetInt();
            this.height = decoder.GetFloat();
            this.weight = decoder.GetDouble();
            var subSubValue = decoder.GetObject <SubSubValue>();

            if (subSubValue.HasValue)
            {
                this.subSubValue = subSubValue.Value;
            }
        }
예제 #3
0
        public void Decode(IDecoder decoder)
        {
            this.intVal    = decoder.GetInt();
            this.shortVal  = decoder.GetShort();
            this.longVal   = decoder.GetLong();
            this.uintVal   = decoder.GetUInt();
            this.ushortVal = decoder.GetUShort();
            this.ulongVal  = decoder.GetULong();
            this.stringVal = decoder.GetString();
            this.bytesVal  = decoder.GetBytes();
            var subValue = decoder.GetObject <SubValue>();

            if (subValue.HasValue)
            {
                this.subValue = subValue.Value;
            }
        }