示例#1
0
        public override bool ControlDefinesThemeForElement(RadElement element)
        {
            Type elementType = element.GetType();

            if (elementType == typeof(RadButtonElement) ||
                elementType == typeof(RadRibbonBarButtonGroup) ||
                elementType == typeof(RadRibbonBarElement) ||
                elementType == typeof(RadScrollViewer) ||
                elementType == typeof(RadCheckBoxElement) ||
                elementType == typeof(RadToggleButtonElement) ||
                elementType == typeof(RadDropDownButtonElement) ||
                elementType == typeof(RadRepeatButtonElement)
                )
            {
                return(true);
            }

            if (elementType.Equals(typeof(RadTextBoxElement)))
            {
                if (element.FindAncestorByThemeEffectiveType(typeof(RadComboBoxElement)) != null)
                {
                    return(true);
                }
            }
            else if (elementType.Equals(typeof(RadMaskedEditBoxElement)))
            {
                if (element.FindAncestor <RadDateTimePickerElement>() != null)
                {
                    return(true);
                }
            }

            return(false);
        }
示例#2
0
 public override bool ControlDefinesThemeForElement(RadElement element)
 {
     if (this.OwnerElement != null && this.ownerElement.ElementTree != null)
     {
         RadControl control = this.OwnerElement.ElementTree.Control as RadControl;
         if (control != null && this.OwnerElement is IDropDownMenuOwner)
         {
             if (((IDropDownMenuOwner)this.OwnerElement).DropDownInheritsThemeClassName)
             {
                 return(control.ControlDefinesThemeForElement(element));
             }
             return(((IDropDownMenuOwner)this.OwnerElement).ControlDefinesThemeForElement(element));
         }
     }
     System.Type type = element.GetType();
     if (type.Equals(typeof(RadTextBoxElement)))
     {
         if (element.FindAncestorByThemeEffectiveType(typeof(RadDropDownListElement)) != null)
         {
             return(true);
         }
     }
     else if (type.Equals(typeof(RadMaskedEditBoxElement)) && element.FindAncestor <RadDateTimePickerElement>() != null)
     {
         return(true);
     }
     return(base.ControlDefinesThemeForElement(element));
 }
示例#3
0
        public override bool ControlDefinesThemeForElement(RadElement element)
        {
            Type elementType = element.GetType();

            if (elementType == typeof(RadButtonElement))
            {
                return(true);
            }

            if (elementType == typeof(RadMenuElement))
            {
                return(true);
            }

            if (elementType == typeof(RadToolStripManager))
            {
                return(true);
            }

            if (elementType.Equals(typeof(RadTextBoxElement)))
            {
                if (element.FindAncestorByThemeEffectiveType(typeof(RadComboBoxElement)) != null)
                {
                    return(true);
                }
            }
            else if (elementType.Equals(typeof(RadMaskedEditBoxElement)))
            {
                if (element.FindAncestor <RadDateTimePickerElement>() != null)
                {
                    return(true);
                }
            }

            return(false);
        }