From 6a6ea678c5d0520816753e2baaffc4adf97b36af Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Fri, 5 Feb 2016 12:10:55 +0100 Subject: [PATCH] code clean --- src/GraphicObjects/GraphicObject.cs | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index ffdaa47c..c0f9bab0 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -1243,7 +1243,7 @@ namespace Crow if (string.IsNullOrEmpty (attValue)) continue; - + MemberInfo mi = thisType.GetMember (attName).FirstOrDefault(); if (mi == null) { Debug.WriteLine ("GOML: Unknown attribute in " + thisType.ToString() + " : " + attName); @@ -1256,8 +1256,10 @@ namespace Crow if (mi.MemberType == MemberTypes.Property) { PropertyInfo pi = mi as PropertyInfo; - if (pi.GetSetMethod () == null) + if (pi.GetSetMethod () == null) { + Debug.WriteLine ("GOML: Read only property in " + thisType.ToString() + " : " + attName); continue; + } bool isAttribute = false; object defaultValue = null; @@ -1278,19 +1280,6 @@ namespace Crow } if (!isAttribute) continue; -// { -// //avoid system types automaticaly converted by parser -// if (defaultValue != null && !pi.PropertyType.Namespace.StartsWith("System")) { -// if (pi.PropertyType != defaultValue.GetType()) { -// MethodInfo miParse = pi.PropertyType.GetMethod ("Parse", BindingFlags.Static | BindingFlags.Public); -// if (miParse != null) { -// pi.SetValue (this, miParse.Invoke (null, new object[]{ defaultValue }), null); -// continue; -// } -// } -// } -// pi.SetValue (this, defaultValue, null); -// } else { if (attValue.StartsWith("{")) { //binding -- 2.47.3