private string GetBuilderString(XmlStyleBuilderRegistration builder) { string res = string.Empty; if (builder.StylesheetRelations.Count != 1) { throw new InvalidOperationException("Stylesheet registration contais relations for more than one control"); } RadStylesheetRelation relation = builder.StylesheetRelations[0]; if (relation.RegistrationType == BuilderRegistrationType.ElementTypeControlType) { res = "Style for controls of Type " + relation.ControlType; if (relation.ElementType != typeof(RootRadElement).FullName) { res += " and elements of Type " + relation.ElementType; } } else if (relation.RegistrationType == BuilderRegistrationType.ElementTypeDefault) { res = "Style for elements of Type " + relation.ElementType; } else if (relation.RegistrationType == BuilderRegistrationType.ElementTypeDefault) { res = "Style for elements of Type " + relation.ElementType; } return(res); }
/// <summary> /// Initializes a new instance of the XmlTheme class from an existing theme. /// </summary> /// <param name="theme"></param> public XmlTheme(Theme theme) { this.themeName = theme.ThemeName; foreach (KeyValuePair <string, object> entry in theme.ThemeProperties) { this.ThemeProperties.Add(entry); } ArrayList list = new ArrayList(); foreach (StyleBuilderRegistration registration in theme.GetRegisteredStyleBuilders()) { XmlStyleBuilderRegistration xmlReg = new XmlStyleBuilderRegistration(registration); list.Add(xmlReg); } builderRegistrations = new XmlStyleBuilderRegistration[list.Count]; if (list.Count > 0) { list.CopyTo(builderRegistrations, 0); } this.repository = theme.Repository; }
private void tvBuilders_AfterSelect(object sender, TreeViewEventArgs e) { XmlStyleBuilderRegistration reg = (XmlStyleBuilderRegistration)e.Node.Tag; this.tvPropertySettingGroups.Nodes.Clear(); this.CurrentStyle = (XmlStyleSheet)reg.BuilderData; if (CurrentStyle != null) { foreach (XmlPropertySettingGroup group in CurrentStyle.PropertySettingGroups) { TreeNode node = AddPropertySettingGroup(group); foreach (XmlElementSelector selector in group.Selectors) { AddSelector(node.Nodes[0], selector); } foreach (XmlPropertySetting setting in group.PropertySettings) { AddSetting(node.Nodes[1], setting); } } } }