private static void ApplySceneItemToControl(SceneItem item, Control ctrl) { Type type = ctrl.GetType(); SceneRenderBase render; //检测是否是特殊控件,并已经注册 if (Scene.regRenderList.TryGetValue(type, out render) == false) { render = new SceneRenderBase(ctrl.GetType()); } render.RenderEnabled(ctrl, item.Enabled); render.RenderReadOnly(ctrl, item.ReadOnly); render.RenderVisible(ctrl, item.Visible); render.RenderHtmlAttributes(ctrl, item.Attributes); render.RenderHtmlStyles(ctrl, item.Styles); render.RenderSubItems(ctrl, item.SubItems); if (item.Recursive) { foreach (Control child in ctrl.Controls) { ApplySceneItemToControl(item, child); } } }
private static void ApplySceneItemToControl(SceneItem item, Control ctrl) { SceneRenderBase render = GetRegisteredRender(ctrl.GetType()); render.RenderEnabled(ctrl, item.Enabled); render.RenderReadOnly(ctrl, item.ReadOnly); render.RenderVisible(ctrl, item.Visible); render.RenderHtmlAttributes(ctrl, item.Attributes); render.RenderHtmlStyles(ctrl, item.Styles); render.RenderSubItems(ctrl, item.SubItems); if (item.Recursive) { foreach (Control child in ctrl.Controls) { ApplySceneItemToControl(item, child); } } }