mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 13:10:00 -07:00
Only setting value if we can write them, this solved a problem with cloneTo for an ini configuration object.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1622 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
affbfb0ce6
commit
2ba4b6f838
1 changed files with 3 additions and 1 deletions
|
@ -63,9 +63,11 @@ namespace GreenshotPlugin.Core {
|
||||||
PropertyInfo[] myObjectProperties = type.GetProperties(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
|
PropertyInfo[] myObjectProperties = type.GetProperties(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
|
||||||
|
|
||||||
foreach (PropertyInfo pi in myObjectProperties) {
|
foreach (PropertyInfo pi in myObjectProperties) {
|
||||||
|
if (pi.CanWrite) {
|
||||||
pi.SetValue(destination, pi.GetValue(source, null), null);
|
pi.SetValue(destination, pi.GetValue(source, null), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static bool CompareLists<T>(IList<T> l1, IList<T> l2) {
|
public static bool CompareLists<T>(IList<T> l1, IList<T> l2) {
|
||||||
if (l1.Count != l2.Count) {
|
if (l1.Count != l2.Count) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue