コード例 #1
0
        internal override void Update(ChannelModel model)
        {
            if (model.Position.HasValue)
            {
                Position = model.Position.Value;
            }

            if (model.PermissionOverwrites.HasValue)
            {
                Overwrites = model.PermissionOverwrites.Value.ToReadOnlyList(this, (x, @this) =>
                {
                    var overwrite           = new RestOverwrite(@this.Client, @this.Id, x);
                    overwrite.Channel.Value = @this;
                    return(overwrite);
                });
            }

            base.Update(model);
        }
コード例 #2
0
ファイル: RestGuildChannel.cs プロジェクト: Anu6is/Disqord
        internal override void Update(ChannelModel model)
        {
            if (model.Position.HasValue)
            {
                Position = model.Position.Value;
            }

            if (model.PermissionOverwrites.HasValue)
            {
                Overwrites = model.PermissionOverwrites.Value.Select(x =>
                {
                    var overwrite = new RestOverwrite(Client, x, Id);
                    overwrite.Channel.SetValue(this);
                    return(overwrite);
                }).ToImmutableArray();
            }

            base.Update(model);
        }