示例#1
0
    } //TestRefer::Reuse()

    public TestRefer Copy(TestRefer from_)
    {
        if (null == from_ || this == from_) {
            return this;
        }
        this.numberi08 = from_.numberi08;
        this.numberi16 = from_.numberi16;
        this.numberi32 = from_.numberi32;
        this.numberi64 = from_.numberi64;
        this.numberu08 = from_.numberu08;
        this.numberu16 = from_.numberu16;
        this.numberu32 = from_.numberu32;
        this.numberu64 = from_.numberu64;
        this.numberSingle = from_.numberSingle;
        this.numberDouble = from_.numberDouble;
        this.boolValue = from_.boolValue;
        this.stringValue = from_.stringValue;
        this.enumValue = from_.enumValue;
        this.other.Copy(from_.other);
        if (null == from_.self) {
            this.self = null;
        } else {
            if (null == this.self) { this.self = new TestRefer(); }
            this.self.Copy(from_.self);
        }
        this.listI08.Clear();
        this.listI08.AddRange(from_.listI08);
        this.dictI08.Clear();
        foreach (var dictI08Iter in from_.dictI08) {
            this.dictI08.Add(dictI08Iter.Key, dictI08Iter.Value);
        }
        return this;
    } //TestRefer::Copy(...)
示例#2
0
    } //TestRefer::Copy(...)

    public void Read(BinaryReader r)
    {
        this.numberi08 = r.ReadSByte();
        this.numberi16 = r.ReadInt16();
        this.numberi32 = r.ReadInt32();
        this.numberi64 = r.ReadInt64();
        this.numberu08 = r.ReadByte();
        this.numberu16 = r.ReadUInt16();
        this.numberu32 = r.ReadUInt32();
        this.numberu64 = r.ReadUInt64();
        this.numberSingle = r.ReadSingle();
        this.numberDouble = r.ReadDouble();
        this.boolValue = r.ReadBoolean();
        this.stringValue = Encoding.UTF8.GetString(r.ReadBytes(r.ReadInt32()));
        this.enumValue = (Gender)Enum.ToObject(typeof(Gender), r.ReadInt32());
        this.other.Read(r);
        sbyte selfExists = r.ReadSByte();
        if ((sbyte)0x01 == selfExists) {
            if (this.self == null) { this.self = new TestRefer(); }
            this.self.Read(r);
        }
        else if ((sbyte)0x00 == selfExists) { this.self = null; }
        else { throw new IOException("Protoc read error: The value of 'selfExists' is invalid.", 497); }
        UInt32 lenListI08 = r.ReadUInt32();
        for (UInt32 iListI08 = 0; iListI08 < lenListI08; iListI08++) {
            SByte n1 = r.ReadSByte();
            this.listI08.Add(n1);
        }
        UInt32 lenDictI08 = r.ReadUInt32();
        for (UInt32 iDictI08 = 0; iDictI08 < lenDictI08; iDictI08++) {
            SByte k1 = r.ReadSByte();
            SByte v1 = r.ReadSByte();
            if (!this.dictI08.ContainsKey(k1)) {
                this.dictI08.Add(k1, v1);
            } else {
                this.dictI08[k1] = v1;
            }
        }
    } //TestRefer::Read(...)
示例#3
0
 public TestRefer SetSelf(TestRefer value) { this.self = value; return this; }