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,7 +63,9 @@ namespace GreenshotPlugin.Core {
PropertyInfo[] myObjectProperties = type.GetProperties(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
foreach (PropertyInfo pi in myObjectProperties) {
pi.SetValue(destination, pi.GetValue(source, null), null);
if (pi.CanWrite) {
pi.SetValue(destination, pi.GetValue(source, null), null);
}
}
}