Пример #1
0
        public void Add(HashTrackerItem2 item)
        {
            lock (List)
            {
                var found = List.FirstOrDefault(n => n.Equals(item));

                if (found == null)
                {
                    List.Add(item);
                }
            }
        }
Пример #2
0
        public HashTrackerItem2 GetItem(FileInfo fi)
        {
            lock (List)
            {
                HashTrackerItem2 item = List.SingleOrDefault(n => n.Path == fi.FullName && n.Length == fi.Length);

                if (item != null)
                {
                    return(item);
                }
                else
                {
                    item = new HashTrackerItem2(fi);
                    List.Add(item);
                    return(item);
                }
            }
        }