-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README.md Update Installation.md Desktop install docs. Z Bulkextensions, and Memory Caching Cache eviction Caching Set eviction policy Actually use the actual cache. D'oh Refactoring Licence Settings Fix settings bug. Tidying First cut of Search rework #255 More filters Filter UI Rework nest steps. #255 Layout Tidying Untagged images filter Untagged hint SQL Fixes Props Filter hints UI Search UI Rework 99% complete. Fix unidentified faces search Group image object tags DistinctBy Searchbar work Mousover Z-order sorting Z-order sorting. 2nd attempt... Fix people mapping Searchbar layout Patch Push fix Discard instead of await Replace FTS generation with triggers Cache eviction fix Update deps Bump version Preload more stuff during search Update SearchService.cs Cache Set cache size Cache ordering
- Loading branch information
Showing
65 changed files
with
3,441 additions
and
875 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
using System.Linq; | ||
|
||
namespace Damselfly.Core.Utils | ||
{ | ||
/// <summary> | ||
/// https://stackoverflow.com/questions/3445784/copy-the-property-values-to-another-object-with-c-sharp | ||
/// </summary> | ||
public static class ObjectUtils | ||
{ | ||
public static bool CopyPropertiesTo<T, TU>(this T source, TU dest) | ||
{ | ||
bool changed = false; | ||
var sourceProps = typeof(T).GetProperties().Where(x => x.CanRead).ToList(); | ||
var destProps = typeof(TU).GetProperties().Where(x => x.CanWrite).ToList(); | ||
|
||
foreach (var sourceProp in sourceProps) | ||
{ | ||
var destProp = destProps.FirstOrDefault(x => x.Name == sourceProp.Name); | ||
|
||
if (destProp != null ) | ||
{ | ||
var newVal = sourceProp.GetValue(source, null); | ||
var prevVal = destProp.GetValue(dest, null); | ||
|
||
if (newVal == null && prevVal == null) | ||
continue; | ||
|
||
if( newVal == null ) | ||
{ | ||
destProp.SetValue(dest, null); | ||
Logging.LogVerbose($"Setting property {destProp.Name} to NULL"); | ||
changed = true; | ||
continue; | ||
} | ||
|
||
if( ! newVal.Equals( prevVal ) ) | ||
{ | ||
Logging.LogVerbose($"Setting property {destProp.Name} to {newVal}"); | ||
// check if the property can be set or no. | ||
destProp.SetValue(dest, newVal); | ||
changed = true; | ||
} | ||
} | ||
} | ||
|
||
return changed; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.