/// <summary> /// returns the value of an object, unless its an ITransformObject. Then /// the getTransformedValue will get called and returned. /// </summary> /// <param name="source"></param> /// <returns></returns> private static object getValue(object source) { object result = source; if (result is ITransformObject) { ITransformObject transformObject = (ITransformObject)result; result = transformObject.getTransformedValue(); } //else //{ // Type t = source.GetType(); // if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(IList<>)) // { // IList a = source as IList; // Type itemType = t.GetGenericArguments()[0]; // if (itemType == typeof(IRestoreObject)) // { // return source as // } // } // // else if (value is IEnumerable<KeyValuePair<object, object>>) // // { // // //foreach (object o in (value as IEnumerable<K>) // // } // // else // // { // // field.SetValue(target, value); // // } // //} // //else // //{ // // field.SetValue(target, value); // //} //} return(result); }