mirror of
https://github.com/wagesj45/mdfinder.git
synced 2025-09-09 03:20:38 -05:00
Period Checkin
This commit is contained in:
parent
f81e4f13da
commit
be05120bdb
28 changed files with 1541 additions and 42 deletions
|
|
@ -25,9 +25,9 @@ namespace mdfinder
|
|||
/// <value> The database. </value>
|
||||
private LiteDatabase Database { get; set; }
|
||||
|
||||
/// <summary> Gets the file records. </summary>
|
||||
/// <value> The file records. </value>
|
||||
public LiteCollection<FileRecord> FileRecords
|
||||
/// <summary> Gets a collection of file records. </summary>
|
||||
/// <value> A collection of file records. </value>
|
||||
private LiteCollection<FileRecord> FileRecordCollection
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -35,15 +35,6 @@ namespace mdfinder
|
|||
}
|
||||
}
|
||||
|
||||
public IEnumerable<FileRecord> ASDF
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.FileRecords.FindAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
|
@ -72,8 +63,33 @@ namespace mdfinder
|
|||
/// <param name="hashProvider"> The hash provider. </param>
|
||||
public void InsertFileRecord(string path, long size, string hash, string hashProvider)
|
||||
{
|
||||
this.FileRecords.Insert(new FileRecord() { Path = path, Size = size, Hash = hash, HashProvider = hashProvider });
|
||||
OnPropertyChanged("ASDF");
|
||||
var fileRecord = new FileRecord() { Path = new Uri(path), Size = size, Hash = hash, HashProvider = hashProvider };
|
||||
this.FileRecordCollection.Insert(fileRecord);
|
||||
}
|
||||
|
||||
/// <summary> Gets the file records in this collection. </summary>
|
||||
/// <returns>
|
||||
/// An enumerator that allows foreach to be used to process the file records in this collection.
|
||||
/// </returns>
|
||||
public IEnumerable<FileRecord> GetFileRecords()
|
||||
{
|
||||
return this.FileRecordCollection.FindAll();
|
||||
}
|
||||
|
||||
/// <summary> Gets the file records in this collection. </summary>
|
||||
/// <param name="predicate"> The predicate. </param>
|
||||
/// <returns>
|
||||
/// An enumerator that allows foreach to be used to process the file records in this collection.
|
||||
/// </returns>
|
||||
public IEnumerable<FileRecord> GetFileRecords(Func<FileRecord, bool> predicate)
|
||||
{
|
||||
return this.FileRecordCollection.Find(fr => predicate(fr));
|
||||
}
|
||||
|
||||
/// <summary> Clears the database to its blank/initial state. </summary>
|
||||
public void Clear()
|
||||
{
|
||||
this.FileRecordCollection.Delete(Query.All());
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue