public void SetBanInfo(BanChangeType changeType, BanInfo banInfo) { if (changeType == BanChangeType.Ban) { base.BanInfo = banInfo; } else { base.BanInfo = BanInfo.Empty; } }
void IUserServiceCallback.OnUsersBanChanged(SignatureDate signatureDate, BanInfo[] banInfos, BanChangeType changeType, string[] comments) { throw new NotImplementedException(); }
public static object[] Build(object[] items, BanChangeType changeType, string[] comments) { return(new object[] { changeType, comments }); }
public static object[] Build(object[] items, BanChangeType changeType) { return(Build(items, changeType, items.Select(item => string.Empty).ToArray())); }
void IUserServiceCallback.OnUsersBanChanged(SignatureDate signatureDate, BanInfo[] banInfos, BanChangeType changeType, string[] comments) { this.InvokeAsync(() => { var authentication = this.Authenticate(signatureDate); var users = new User[banInfos.Length]; for (var i = 0; i < banInfos.Length; i++) { var banInfo = banInfos[i]; var user = this[banInfo.Path] as User; user.SetBanInfo(changeType, banInfo); users[i] = user; } switch (changeType) { case BanChangeType.Ban: this.Users.InvokeUsersBannedEvent(authentication, users, comments); break; case BanChangeType.Unban: this.Users.InvokeUsersUnbannedEvent(authentication, users); break; } }, nameof(IUserServiceCallback.OnUsersBanChanged)); }