Пример #1
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_Name      = false;
                bool   isset_ID        = false;
                bool   isset_Language  = false;
                bool   isset_Addresses = 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.String)
                        {
                            Name       = iprot.ReadString();
                            isset_Name = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

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

                    case 3:
                        if (field.Type == TType.String)
                        {
                            Language       = iprot.ReadString();
                            isset_Language = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.List)
                        {
                            {
                                Addresses = new List <MMIStandard.MIPAddress>();
                                TList _list0 = iprot.ReadListBegin();
                                for (int _i1 = 0; _i1 < _list0.Count; ++_i1)
                                {
                                    MMIStandard.MIPAddress _elem2;
                                    _elem2 = new MMIStandard.MIPAddress();
                                    _elem2.Read(iprot);
                                    Addresses.Add(_elem2);
                                }
                                iprot.ReadListEnd();
                            }
                            isset_Addresses = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.Map)
                        {
                            {
                                Properties = new Dictionary <string, string>();
                                TMap _map3 = iprot.ReadMapBegin();
                                for (int _i4 = 0; _i4 < _map3.Count; ++_i4)
                                {
                                    string _key5;
                                    string _val6;
                                    _key5             = iprot.ReadString();
                                    _val6             = iprot.ReadString();
                                    Properties[_key5] = _val6;
                                }
                                iprot.ReadMapEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.List)
                        {
                            {
                                Parameters = new List <MMIStandard.MParameter>();
                                TList _list7 = iprot.ReadListBegin();
                                for (int _i8 = 0; _i8 < _list7.Count; ++_i8)
                                {
                                    MMIStandard.MParameter _elem9;
                                    _elem9 = new MMIStandard.MParameter();
                                    _elem9.Read(iprot);
                                    Parameters.Add(_elem9);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_Name)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Name not set");
                }
                if (!isset_ID)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field ID not set");
                }
                if (!isset_Language)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Language not set");
                }
                if (!isset_Addresses)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Addresses not set");
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
Пример #2
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_Name         = false;
                bool   isset_ID           = false;
                bool   isset_AssemblyName = false;
                bool   isset_MotionType   = false;
                bool   isset_Language     = false;
                bool   isset_Author       = false;
                bool   isset_Version      = 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.String)
                        {
                            Name       = iprot.ReadString();
                            isset_Name = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

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

                    case 3:
                        if (field.Type == TType.String)
                        {
                            AssemblyName       = iprot.ReadString();
                            isset_AssemblyName = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.String)
                        {
                            MotionType       = iprot.ReadString();
                            isset_MotionType = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.String)
                        {
                            Language       = iprot.ReadString();
                            isset_Language = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.String)
                        {
                            Author       = iprot.ReadString();
                            isset_Author = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.String)
                        {
                            Version       = iprot.ReadString();
                            isset_Version = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 9:
                        if (field.Type == TType.List)
                        {
                            {
                                Prerequisites = new List <MMIStandard.MConstraint>();
                                TList _list41 = iprot.ReadListBegin();
                                for (int _i42 = 0; _i42 < _list41.Count; ++_i42)
                                {
                                    MMIStandard.MConstraint _elem43;
                                    _elem43 = new MMIStandard.MConstraint();
                                    _elem43.Read(iprot);
                                    Prerequisites.Add(_elem43);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 11:
                        if (field.Type == TType.Map)
                        {
                            {
                                Properties = new Dictionary <string, string>();
                                TMap _map44 = iprot.ReadMapBegin();
                                for (int _i45 = 0; _i45 < _map44.Count; ++_i45)
                                {
                                    string _key46;
                                    string _val47;
                                    _key46             = iprot.ReadString();
                                    _val47             = iprot.ReadString();
                                    Properties[_key46] = _val47;
                                }
                                iprot.ReadMapEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 12:
                        if (field.Type == TType.List)
                        {
                            {
                                Dependencies = new List <MDependency>();
                                TList _list48 = iprot.ReadListBegin();
                                for (int _i49 = 0; _i49 < _list48.Count; ++_i49)
                                {
                                    MDependency _elem50;
                                    _elem50 = new MDependency();
                                    _elem50.Read(iprot);
                                    Dependencies.Add(_elem50);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 13:
                        if (field.Type == TType.List)
                        {
                            {
                                Events = new List <string>();
                                TList _list51 = iprot.ReadListBegin();
                                for (int _i52 = 0; _i52 < _list51.Count; ++_i52)
                                {
                                    string _elem53;
                                    _elem53 = iprot.ReadString();
                                    Events.Add(_elem53);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

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

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

                    case 16:
                        if (field.Type == TType.List)
                        {
                            {
                                Parameters = new List <MMIStandard.MParameter>();
                                TList _list54 = iprot.ReadListBegin();
                                for (int _i55 = 0; _i55 < _list54.Count; ++_i55)
                                {
                                    MMIStandard.MParameter _elem56;
                                    _elem56 = new MMIStandard.MParameter();
                                    _elem56.Read(iprot);
                                    Parameters.Add(_elem56);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 17:
                        if (field.Type == TType.List)
                        {
                            {
                                SceneParameters = new List <MMIStandard.MParameter>();
                                TList _list57 = iprot.ReadListBegin();
                                for (int _i58 = 0; _i58 < _list57.Count; ++_i58)
                                {
                                    MMIStandard.MParameter _elem59;
                                    _elem59 = new MMIStandard.MParameter();
                                    _elem59.Read(iprot);
                                    SceneParameters.Add(_elem59);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

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

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

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

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

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_Name)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Name not set");
                }
                if (!isset_ID)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field ID not set");
                }
                if (!isset_AssemblyName)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field AssemblyName not set");
                }
                if (!isset_MotionType)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field MotionType not set");
                }
                if (!isset_Language)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Language not set");
                }
                if (!isset_Author)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Author not set");
                }
                if (!isset_Version)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Version not set");
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }