예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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;
            }
        }
예제 #4
0
        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);
        }
예제 #5
0
 public MetadataActionEventArgs(UIProperties props, VsbElementMetadata metadata)
 {
     this.uiProperties = props;
     this.metadata     = metadata;
 }
예제 #6
0
 public virtual Type GetStyleRelatedElementType(VsbElementMetadata metadata)
 {
     return(metadata.StyleRelatedElementType);
 }
예제 #7
0
 /// <summary>
 /// Allows metadata to provide specific element instances.
 /// </summary>
 /// <param name="metadata"></param>
 /// <returns></returns>
 public virtual RadElement GetElementInstance(VsbElementMetadata metadata)
 {
     return(null);
 }