public override void InitCloneControlProperties(Control currentControl, ControlPropertyDefineWrapper propertyDefineWrapper) { base.InitCloneControlProperties(currentControl, propertyDefineWrapper); if (!propertyDefineWrapper.UseTemplate) { var extendedSettings = propertyDefineWrapper.ExtendedSettings; if (extendedSettings.IsNotEmpty()) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(extendedSettings); if (xmlDoc.ChildNodes.Count > 0) { SettleControlColumnsFromXmlNode(currentControl, xmlDoc.ChildNodes[0]); } } } }
public virtual void InitCloneControlProperties(Control currentControl, ControlPropertyDefineWrapper propertyDefineWrapper) { if (propertyDefineWrapper != null && !propertyDefineWrapper.UseTemplate) { if (propertyDefineWrapper.ControlPropertyDefineList != null) { foreach (ControlPropertyDefine define in propertyDefineWrapper.ControlPropertyDefineList) { PropertyInfo piDest = TypePropertiesCacheQueue.Instance.GetPropertyInfo(currentControl.GetType(), define.PropertyName); if (piDest != null) { if (string.IsNullOrEmpty(define.StringValue) == true || piDest.CanWrite == false) continue; if (piDest.PropertyType == typeof(Unit)) piDest.SetValue(currentControl, Unit.Parse(define.StringValue), null); else piDest.SetValue(currentControl, define.GetRealValue(), null); } } } } }