Exemple #1
0
        /* Вносит человека в черный список */
        public void BannedPeople(long?lpUserId, ref BannedUsers lpList)
        {
            lpList.Banned.Add(lpUserId.ToString());
            var lpResult = JsonConvert.SerializeObject(lpList, Newtonsoft.Json.Formatting.Indented);

            using (var sw = new StreamWriter(lpBannedUserFile, false, System.Text.Encoding.Default))
            {
                sw.WriteLineAsync(lpResult);
            }

            _lpBanned = lpList;
        }
Exemple #2
0
        /* Удаляет человека из чёрного листа */
        public bool UnbannedPeople(long?lpUserId, ref BannedUsers lpList)
        {
            var lpStatus = lpList.Banned.Remove(lpUserId.ToString());

            if (!lpStatus)
            {
                return(lpStatus);
            }
            var lpResult = JsonConvert.SerializeObject(lpList, Newtonsoft.Json.Formatting.Indented);

            using (var sw = new StreamWriter(lpBannedUserFile, false, System.Text.Encoding.Default))
            {
                sw.WriteLineAsync(lpResult);
            }
            _lpBanned = lpList;
            return(lpStatus);
        }
Exemple #3
0
 /* Конструктор */
 public Admin(Admins lpSourcesAdmin, BannedUsers lpSourcesBanned)
 {
     _lpAdmins = lpSourcesAdmin;
     _lpBanned = lpSourcesBanned;
 }