コード例 #1
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("SquareFeatureSet");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (SquareMid != null && __isset.squareMid)
         {
             field.Name = "squareMid";
             field.Type = TType.String;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(SquareMid);
             oprot.WriteFieldEnd();
         }
         if (__isset.revision)
         {
             field.Name = "revision";
             field.Type = TType.I64;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             oprot.WriteI64(Revision);
             oprot.WriteFieldEnd();
         }
         if (CreatingSecretSquareChat != null && __isset.creatingSecretSquareChat)
         {
             field.Name = "creatingSecretSquareChat";
             field.Type = TType.Struct;
             field.ID   = 11;
             oprot.WriteFieldBegin(field);
             CreatingSecretSquareChat.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (InvitingIntoOpenSquareChat != null && __isset.invitingIntoOpenSquareChat)
         {
             field.Name = "invitingIntoOpenSquareChat";
             field.Type = TType.Struct;
             field.ID   = 12;
             oprot.WriteFieldBegin(field);
             InvitingIntoOpenSquareChat.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }
コード例 #2
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("SquareFeatureSet(");
        bool __first = true;

        if (SquareMid != null && __isset.squareMid)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("SquareMid: ");
            sb.Append(SquareMid);
        }
        if (__isset.revision)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Revision: ");
            sb.Append(Revision);
        }
        if (CreatingSecretSquareChat != null && __isset.creatingSecretSquareChat)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("CreatingSecretSquareChat: ");
            sb.Append(CreatingSecretSquareChat == null ? "<null>" : CreatingSecretSquareChat.ToString());
        }
        if (InvitingIntoOpenSquareChat != null && __isset.invitingIntoOpenSquareChat)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("InvitingIntoOpenSquareChat: ");
            sb.Append(InvitingIntoOpenSquareChat == null ? "<null>" : InvitingIntoOpenSquareChat.ToString());
        }
        sb.Append(")");
        return(sb.ToString());
    }
コード例 #3
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.squareMid)
            {
                hashcode = (hashcode * 397) + SquareMid.GetHashCode();
            }
            if (__isset.revision)
            {
                hashcode = (hashcode * 397) + Revision.GetHashCode();
            }
            if (__isset.creatingSecretSquareChat)
            {
                hashcode = (hashcode * 397) + CreatingSecretSquareChat.GetHashCode();
            }
            if (__isset.invitingIntoOpenSquareChat)
            {
                hashcode = (hashcode * 397) + InvitingIntoOpenSquareChat.GetHashCode();
            }
        }
        return(hashcode);
    }
コード例 #4
0
    public async Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
    {
        oprot.IncrementRecursionDepth();
        try
        {
            var struc = new TStruct("SquareFeatureSet");
            await oprot.WriteStructBeginAsync(struc, cancellationToken);

            var field = new TField();
            if (SquareMid != null && __isset.squareMid)
            {
                field.Name = "squareMid";
                field.Type = TType.String;
                field.ID   = 1;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await oprot.WriteStringAsync(SquareMid, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);
            }
            if (__isset.revision)
            {
                field.Name = "revision";
                field.Type = TType.I64;
                field.ID   = 2;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await oprot.WriteI64Async(Revision, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);
            }
            if (CreatingSecretSquareChat != null && __isset.creatingSecretSquareChat)
            {
                field.Name = "creatingSecretSquareChat";
                field.Type = TType.Struct;
                field.ID   = 11;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await CreatingSecretSquareChat.WriteAsync(oprot, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);
            }
            if (InvitingIntoOpenSquareChat != null && __isset.invitingIntoOpenSquareChat)
            {
                field.Name = "invitingIntoOpenSquareChat";
                field.Type = TType.Struct;
                field.ID   = 12;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await InvitingIntoOpenSquareChat.WriteAsync(oprot, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);
            }
            await oprot.WriteFieldStopAsync(cancellationToken);

            await oprot.WriteStructEndAsync(cancellationToken);
        }
        finally
        {
            oprot.DecrementRecursionDepth();
        }
    }