示例#1
0
        public static void Add(LogElem elem)
        {
            if (Buffer == null)
            {
                Buffer = new List <LogElem>();
            }

            while (Buffer.Count > 40)
            {
                Buffer.RemoveAt(0);
            }
            //Тут допишем код для удаления
            Buffer.Add(elem);
        }
示例#2
0
        public static void Add(LogElem elem)
        {
            if (Buffer == null)
            {
                Buffer = new List <LogElem>();
            }

            while (Buffer.Count > 40)
            {
                Buffer.RemoveAt(0);
            }
            //Тут допишем код для удаления
            Buffer.Add(elem);

            //Следим те кто в онлайн
            AddBufferOnline(elem);
        }
示例#3
0
        public static void AddBufferOnline(LogElem t)
        {
            //Исключим неверные
            if (t.MacAdress == null)
            {
                return;
            }
            if ((t.MacAdress.Trim() == String.Empty) || (t.MacAdress == "-"))
            {
                return;
            }

            if (BufferOnline == null)
            {
                BufferOnline = new List <ElemTsdLog>();
                BufferOnline.Add(new ElemTsdLog(t.Login, t.ClientVersion, t.MacAdress, t.DnsNames));
                return;
            }


            bool find = false;

            foreach (var e in BufferOnline)
            {
                if (e.MacAdress == t.MacAdress)
                {
                    find = true;
                    //Обновим инфу
                    e.Check(t.Login, t.ClientVersion);
                }
            }

            if (!find)
            {//Новый элемент
                BufferOnline.Add(new ElemTsdLog(t.Login, t.ClientVersion, t.MacAdress, t.DnsNames));
            }
        }