public void SetControlProperties(Control control) { if (control == null) { return; } for (int iprop = 0; iprop < properties.Count; iprop++) { SkinElementPropertyInfo propInfo = (SkinElementPropertyInfo)properties[iprop]; if (propInfo == null) { continue; } string propName = propInfo.name; Control propControl = control; int idx = -1; if ((idx = propInfo.name.LastIndexOf(".")) != -1) { propControl = ResizableSkinController.GetNamedControl(control, propName.Substring(0, idx)); propName = propName.Substring(idx + 1, propName.Length - idx - 1); } // if (propControl != null) { SetProperty(propControl, propName, propInfo.value); } } }
internal ArrayList LoadProperties(XmlNode xmlNode) { ArrayList mProps = new ArrayList(); foreach (XmlNode node in xmlNode.ChildNodes) { SkinElementPropertyInfo propInfo = (SkinElementPropertyInfo)LoadElement(node); mProps.Add(propInfo); } return(mProps); }
/// <summary> /// Loads the style element from document node. /// </summary> /// <param name="objectNode">document node which repersents object</param> /// <returns>instance of class SlideElement</returns> private Object LoadElement(XmlNode styleNode) { string objectType = styleNode.Name; Object retobject = null; if (objectType == "bitmap") { retobject = new SkinBitmap(sResDir); } if (objectType == "element") { retobject = new SkinBaseElement(); ((SkinBaseElement)retobject).BitmapChanged += new BitmapChangedEventHandler(element_BitmapChanged); } else if (objectType == "control") { retobject = new SkinBaseControl(); ((SkinBaseElement)retobject).BitmapChanged += new BitmapChangedEventHandler(element_BitmapChanged); } else if (objectType == "property") { retobject = new SkinElementPropertyInfo(); } /*else if (objectType == "button") * { * retobject = new FlatToggleButton(); * ((SkinBaseElement)retobject).BitmapChanged += new BitmapChangedEventHandler( element_BitmapChanged); * ((FlatToggleButton)retobject).OnNeedUpdate +=new EventHandler(FormSkin_OnNeedUpdate); * ((FlatToggleButton)retobject).OnClick +=new EventHandler(FormSkin_OnClick); * } * else if (objectType == "dragbutton") * { * retobject = new DragFormButton(); * ((DragFormButton)retobject).OnDragBy +=new MouseEventHandler(FormSkin_OnDragBy); * } * else if (objectType == "resizebutton") * { * retobject = new ResizeFormButton(); * ((ResizeFormButton)retobject).OnResizeBy +=new MouseEventHandler(FormSkin_OnResizeBy); * }*/ if (retobject != null) { foreach (XmlAttribute node in styleNode.Attributes) { SetProperty(retobject, node); } } return(retobject); }