Ejemplo n.º 1
0
        public void SelectedClear(LogUnit start, LogUnit End)
        {
            int st = Math.Min(start.Index, End.Index);
            int ed = Math.Max(start.Index, End.Index);

            var removeItems = this.Items.Where(x => x.Index >= st && x.Index <= ed).ToList();

            foreach (LogUnit unit in removeItems)
            {
                this.Items.Remove(unit);
            }
        }
Ejemplo n.º 2
0
        public void Add(string content, bool bConn = true)
        {
            LogUnit unit = new LogUnit();

            unit.Index       = Index;
            unit.Content     = content;
            unit.Time        = DateTime.Now.ToLongTimeString();
            unit.IsConnected = bConn;

            this.Items.Add(unit);

            Index++;
        }
Ejemplo n.º 3
0
        public void Insert(string content, bool bConn = true)
        {
            LogUnit unit = new LogUnit();

            unit.Index       = Index;
            unit.Content     = content;
            unit.Time        = DateTime.Now.ToLongTimeString();
            unit.IsConnected = bConn;

            this.Items.Insert(0, unit);

            if (bCheckConnect != bConn) //이 상태면 접속상태가 변경된 시점, 시간 저장
            {
                bCheckConnect = bConn;

                LogUnit statUnit = new LogUnit();
                statUnit.Index = Index;
                if (bConn)
                {
                    TimeSpan span = DateTime.Now - preDateTime;

                    string info = DiffTime(span);
                    statUnit.Content = content + ", 오류시간: " + info;
                }
                else
                {
                    preDateTime      = DateTime.Now;
                    statUnit.Content = content;
                }

                statUnit.Time        = DateTime.Now.ToLongTimeString();
                statUnit.IsConnected = bConn;

                this.StatItems.Insert(0, statUnit);
            }

            Index++;
        }
Ejemplo n.º 4
0
 public void Add(LogUnit unit)
 {
     this.Items.Add(unit);
 }