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:
RKrom 2012-02-02 10:50:23 +00:00
commit 2ba4b6f838

View file

@ -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) {