Ejemplo n.º 1
0
 public static InviteChannel FromRpcModel(this THInviteProvider provider, string language)
 {
     return(new InviteChannel {
         Id = provider.ProviderId,
         IconImageUrl = provider.IconUrl,
         DisplayOrder = provider.DisplayOrder,
         Name = provider.Name.ContainsKey(language) ? provider.Name[language] : provider.Name[LanguageCodes.DefaultLanguage]
     });
 }
 public static InviteChannel FromRpcModel(this THInviteProvider provider, string language)
 {
     return(new InviteChannel(
                id: provider.ProviderId,
                name: provider.Name.GetOrDefault(language, provider.Name[LanguageCodes.DefaultLanguage]),
                iconImageUrl: provider.IconUrl,
                displayOrder: provider.DisplayOrder,
                isEnabled: provider.Enabled
                ));
 }
        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.Struct)
                        {
                            DefaultInviteContent = new THInviteContent();
                            DefaultInviteContent.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                Providers = new List <THInviteProvider>();
                                TList _list38 = iprot.ReadListBegin();
                                for (int _i39 = 0; _i39 < _list38.Count; ++_i39)
                                {
                                    THInviteProvider _elem40;
                                    _elem40 = new THInviteProvider();
                                    _elem40.Read(iprot);
                                    Providers.Add(_elem40);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }