예제 #1
0
        private Collection <ProcessedFileInfo> RetrieveDuplicates()
        {
            Collection <ProcessedFileInfo> duplicateFiles = new Collection <ProcessedFileInfo>();

            ComputeHashesForLengthDuplicates();
            using (SQLiteCommand selectCommand = this.databaseConnection.CreateCommand())
            {
                selectCommand.CommandText = sqlHashDupeSelect;
                using (SQLiteDataReader hashDupeReader = selectCommand.ExecuteReader())
                {
                    while (hashDupeReader.Read())
                    {
                        ProcessedFileInfo hashDuplicate = new ProcessedFileInfo(hashDupeReader[sqlColumnFilePath] as String,
                                                                                hashDupeReader[sqlColumnFileName] as String,
                                                                                hashDupeReader[sqlColumnFileSize] as long?,
                                                                                Convert.ToDateTime(hashDupeReader[sqlColumnLastModifyDate]) as DateTime?,
                                                                                hashDupeReader[sqlColumnFileHash] as String);
                        duplicateFiles.Add(hashDuplicate);
                    }
                }
            }
            return(duplicateFiles);
        }
 private Collection<ProcessedFileInfo> RetrieveDuplicates()
 {
     Collection<ProcessedFileInfo> duplicateFiles = new Collection<ProcessedFileInfo>();
     ComputeHashesForLengthDuplicates();
     using (SQLiteCommand selectCommand = this.databaseConnection.CreateCommand())
     {
         selectCommand.CommandText = sqlHashDupeSelect;
         using (SQLiteDataReader hashDupeReader = selectCommand.ExecuteReader())
         {
             while (hashDupeReader.Read())
             {
                 ProcessedFileInfo hashDuplicate = new ProcessedFileInfo(hashDupeReader[sqlColumnFilePath] as String,
                                                                         hashDupeReader[sqlColumnFileName] as String,
                                                                         hashDupeReader[sqlColumnFileSize] as long?,
                                                                         Convert.ToDateTime(hashDupeReader[sqlColumnLastModifyDate]) as DateTime?,
                                                                         hashDupeReader[sqlColumnFileHash] as String);
                 duplicateFiles.Add(hashDuplicate);
             }
         }
     }
     return duplicateFiles;
 }