Beispiel #1
0
        public int Compare(object x, object y)
        {
            if ((x is XFileInfo) && (y is XFileInfo)) // XFileInfo 형변환 여부 체크
            {
                XFileInfo file1 = (XFileInfo)x;
                XFileInfo file2 = (XFileInfo)y;

                if (_isSort)
                {
                    result = String.Compare(file1.CreateDate.ToString(), file2.CreateDate.ToString());
                }
                else
                {
                    result = (-String.Compare(file1.CreateDate.ToString(), file2.CreateDate.ToString()));
                }
            }

            return(result);
        }
Beispiel #2
0
        public void Check(string path, bool bCheckFilter)
        {
            m_FileNameArrayList.Clear();

            XFileInfo  Files;
            MyComparer comparer;

            DirectoryInfo dir = new DirectoryInfo(path);

            foreach (FileInfo file in dir.GetFiles())
            {
                if (XHelper.IsDumpFile(file.Name) == false)
                {
                    continue;
                }
                if (file.Length <= 0)
                {
                    continue;
                }

                if (bCheckFilter)
                {
                    if (CheckFilter(file.CreationTime) == false)
                    {
                        continue;
                    }
                }

                Files = new XFileInfo(file.Name, file.CreationTime);
                m_FileNameArrayList.Add(Files);
            }

            comparer = new MyComparer();

            m_FileNameArrayList.Sort(comparer);
        }