public virtual IElementSelector CreateSelectorForChildMetadata(VsbElementMetadata child, string state) { if (child.UserSelector != null) { return(child.UserSelector); } IElementSelector defaultSelector = CreateDefaultSelector(child); if (!child.CanHaveChildSelector) { // Element metadata equals our theme type. For example GridDataCellElement. if (child.ElementThemeType == this.ElementThemeType) { return(this.CreateOwnSelector(state)); } return(defaultSelector); } IElementSelector ownSelector = this.CreateOwnSelector(state); if (ownSelector != null) { ownSelector.ChildSelector = defaultSelector; return(ownSelector); } return(defaultSelector); }
public StyleBuilderRegistration GetStyleBuilderRegistration(VsbElementMetadata elementMetadata) { string controlType = elementMetadata.StyleRelatedTreeHandlerType; Type elementType = this.GetStyleRelatedElementType(elementMetadata); foreach (StyleBuilderRegistration reg in this.StyleBuilderRegistrations) { foreach (RadStylesheetRelation relation in reg.StylesheetRelations) { if (elementType == null) { if (relation.ControlType.Equals(controlType)) { return(reg); } } else if (elementType != null) { if (relation.ControlType.Equals(controlType) && relation.ElementType.Equals(elementType.FullName)) { return(reg); } } } } return(null); }
public void RemoveChildMetadata(VsbElementMetadata metadata) { metadata.ParentMetadata = null; switch (metadata.MetadataType) { case VsbMetadataType.Element: this.elementSelectorInfos.Remove(metadata); break; case VsbMetadataType.Item: this.childItemInfos.Remove(metadata as VsbItemMetadata); break; } }
public static IElementSelector CreateDefaultSelector(VsbElementMetadata metadata) { //- ClassSelector if element has StateManager or Class assigned //- TypeSelector otherwise //No name selector by default if (!string.IsNullOrEmpty(metadata.ElementClass)) { return(new ClassSelector(metadata.ElementClass)); } else if (metadata.ElementThemeType != null) { return(new TypeSelector(metadata.ElementThemeType)); } return(null); }
public MetadataActionEventArgs(UIProperties props, VsbElementMetadata metadata) { this.uiProperties = props; this.metadata = metadata; }
public virtual Type GetStyleRelatedElementType(VsbElementMetadata metadata) { return(metadata.StyleRelatedElementType); }
/// <summary> /// Allows metadata to provide specific element instances. /// </summary> /// <param name="metadata"></param> /// <returns></returns> public virtual RadElement GetElementInstance(VsbElementMetadata metadata) { return(null); }