コード例 #1
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.String)
                        {
                            NoteGuid = iprot.ReadString();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.I64)
                        {
                            RecipientThreadId = iprot.ReadI64();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                RecipientContacts = new List <Evernote.EDAM.Type.Contact>();
                                TList _list150 = iprot.ReadListBegin();
                                for (int _i151 = 0; _i151 < _list150.Count; ++_i151)
                                {
                                    Evernote.EDAM.Type.Contact _elem152;
                                    _elem152 = new Evernote.EDAM.Type.Contact();
                                    _elem152.Read(iprot);
                                    RecipientContacts.Add(_elem152);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.I32)
                        {
                            Privilege = (Evernote.EDAM.Type.SharedNotePrivilegeLevel)iprot.ReadI32();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #2
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_contacts = false;
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.List)
                        {
                            {
                                Contacts = new List <Evernote.EDAM.Type.Contact>();
                                TList _list0 = iprot.ReadListBegin();
                                for (int _i1 = 0; _i1 < _list0.Count; ++_i1)
                                {
                                    Evernote.EDAM.Type.Contact _elem2;
                                    _elem2 = new Evernote.EDAM.Type.Contact();
                                    _elem2.Read(iprot);
                                    Contacts.Add(_elem2);
                                }
                                iprot.ReadListEnd();
                            }
                            isset_contacts = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.String)
                        {
                            Parameter = iprot.ReadString();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.List)
                        {
                            {
                                Reasons = new List <EDAMInvalidContactReason>();
                                TList _list3 = iprot.ReadListBegin();
                                for (int _i4 = 0; _i4 < _list3.Count; ++_i4)
                                {
                                    EDAMInvalidContactReason _elem5;
                                    _elem5 = (EDAMInvalidContactReason)iprot.ReadI32();
                                    Reasons.Add(_elem5);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_contacts)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Contacts not set");
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }