public override Type GetActualPropertyType(object propertyOwner, PropertyDescriptor property)
        {
            if (propertyOwner is XmlPropertySetting)
            {
                string propertyFullName = (propertyOwner as XmlPropertySetting).Property;
                if (string.IsNullOrEmpty(propertyFullName))
                {
                    return(null);
                }

                RadProperty radProperty = XmlPropertySetting.DeserializeProperty(propertyFullName);
                if (radProperty != null)
                {
                    if (radProperty.PropertyType != null)
                    {
                        return(radProperty.PropertyType);
                    }
                    else
                    {
                    }
                }
            }

            throw new NotSupportedException("Only XmlPropertySetting instances' value can be converted.");
        }
Ejemplo n.º 2
0
        protected internal override object GetDefaultValue(
            RadPropertyValue propVal,
            object baseDefaultValue)
        {
            RadProperty property = propVal.Property;

            if (property == VisualElement.ForeColorProperty)
            {
                return((object)SystemColors.ControlDarkDark);
            }
            if (property == RadElement.AutoSizeModeProperty)
            {
                return((object)RadAutoSizeMode.Auto);
            }
            if (property == RadElement.FitToSizeModeProperty)
            {
                return((object)RadFitToSizeMode.FitToParentBounds);
            }
            if (property != VisualElement.SmoothingModeProperty)
            {
                return(base.GetDefaultValue(propVal, baseDefaultValue));
            }
            if (this.BoxStyle == BorderBoxStyle.FourBorders && this.GetCurrentShape() == null)
            {
                return((object)SmoothingMode.Default);
            }
            return((object)SmoothingMode.AntiAlias);
        }
Ejemplo n.º 3
0
        protected internal override object GetDefaultValue(RadPropertyValue propVal, object baseDefaultValue)
        {
            RadProperty property = propVal.Property;

            if (property == ForeColorProperty)
            {
                return(SystemColors.ControlDarkDark);
            }

            if (property == AutoSizeModeProperty)
            {
                return(RadAutoSizeMode.Auto);
            }

            if (property == FitToSizeModeProperty)
            {
                return(RadFitToSizeMode.FitToParentBounds);
            }

            if (property == SmoothingModeProperty)
            {
                return(SmoothingMode.AntiAlias);
            }

            return(base.GetDefaultValue(propVal, baseDefaultValue));
        }
Ejemplo n.º 4
0
 public CollapsiblePanelMouseEventsStateManagerFactory(
     RadProperty expandDirectionProperty,
     RadProperty isExpandedProperty)
 {
     this.expandDirectionProperty = expandDirectionProperty;
     this.isExpandedProperty      = isExpandedProperty;
 }
Ejemplo n.º 5
0
 public RadCollapsiblePanelElementStateManagerFactory(
     RadProperty expandDirectionProperty,
     RadProperty isExpandedProperty)
 {
     this.expandDirectionProperty = expandDirectionProperty;
     this.isExpandedProperty      = isExpandedProperty;
 }
Ejemplo n.º 6
0
        private void EnsureLightVisualElementProperties()
        {
            bool flag = true;

            if (this.visibilityModifierValue.HasValue)
            {
                flag = this.visibilityModifierValue.Value == ElementVisibility.Visible;
            }
            if (this.itemType == "Gradient")
            {
                RadProperty property = XmlPropertySetting.DeserializePropertySafe("Telerik.WinControls.UI.LightVisualElement.DrawFill");
                if (property == null)
                {
                    return;
                }
                this.deserializedPropertySettings.Add((IPropertySetting) new PropertySetting(property, (object)flag));
            }
            else
            {
                if (!(this.itemType == "Border"))
                {
                    return;
                }
                RadProperty property = XmlPropertySetting.DeserializePropertySafe("Telerik.WinControls.UI.LightVisualElement.DrawBorder");
                if (property == null)
                {
                    return;
                }
                this.deserializedPropertySettings.Add((IPropertySetting) new PropertySetting(property, (object)flag));
            }
        }
        public override bool ShouldSerializeValue(object component)
        {
            bool?serializeFromRadobject = this.GetShouldSerializeFromRadobject(component);

            if (serializeFromRadobject.HasValue && serializeFromRadobject.HasValue)
            {
                return(serializeFromRadobject.Value);
            }
            RadObject        component1    = (RadObject)component;
            RadProperty      radProperty   = this.GetRadProperty(component1);
            RadPropertyValue propertyValue = component1.GetPropertyValue(radProperty);

            if (propertyValue == null || propertyValue.ValueSource != ValueSource.Local && propertyValue.ValueSource != ValueSource.LocalFromBinding)
            {
                return(false);
            }
            if (radProperty == RadElement.BoundsProperty)
            {
                return(!(bool)component1.GetValue(RadElement.AutoSizeProperty));
            }
            if (propertyValue.IsSetAtDesignTime)
            {
                return(true);
            }
            return(this.Wrapped.ShouldSerializeValue(component));
        }
Ejemplo n.º 8
0
        private void EnsureLightVisualElementProperties()
        {
            //If there is a property setting in this repository item that modifies the visibility property
            //we need to map the value of the modifier to bool and pass it to the DrawFill/DrawBorder settings.
            bool lightVisualElementVisibilityModifierValue = true;

            if (this.visibilityModifierValue.HasValue)
            {
                lightVisualElementVisibilityModifierValue = this.visibilityModifierValue.Value == ElementVisibility.Visible ? true : false;
            }

            //check the type of the repository in order to add the DrawFill and DrawBorder properties of LightVisualElement
            if (this.itemType == RepositoryItemTypes.Gradient)
            {
                RadProperty drawFillProperty = XmlPropertySetting.DeserializePropertySafe("Telerik.WinControls.UI.LightVisualElement.DrawFill");
                if (drawFillProperty != null)
                {
                    this.deserializedPropertySettings.Add(new PropertySetting(drawFillProperty, lightVisualElementVisibilityModifierValue));
                }
            }
            else if (this.itemType == RepositoryItemTypes.Border)
            {
                RadProperty drawBorderProperty = XmlPropertySetting.DeserializePropertySafe("Telerik.WinControls.UI.LightVisualElement.DrawBorder");
                if (drawBorderProperty != null)
                {
                    this.deserializedPropertySettings.Add(new PropertySetting(drawBorderProperty, lightVisualElementVisibilityModifierValue));
                }
            }
        }
Ejemplo n.º 9
0
 public void InvalidateCachedPrimitiveHash(RadProperty property)
 {
     if (CacheRelatedPropertyNames.ContainsKey(property.NameHash))
     {
         this.cachedPrimitiveHash = -1;
     }
 }
Ejemplo n.º 10
0
 internal static bool PropertyInvalidatesScrollOffset(RadProperty property)
 {
     return(property == RadPageViewStripElement.StripAlignmentProperty ||
            property == RadPageViewStripElement.ItemFitModeProperty ||
            property == RadPageViewStripElement.ItemAlignmentProperty ||
            property == RadPageViewElement.ItemSizeModeProperty ||
            property == RadPageViewElement.ItemContentOrientationProperty);
 }
 public RadProperty GetRadProperty(RadObject component)
 {
     if (this.radProperty == null)
     {
         this.radProperty = component.GetRegisteredRadProperty(this.Name);
     }
     return(this.radProperty);
 }
Ejemplo n.º 12
0
 public void InvalidateCachedPrimitiveHash(RadProperty property)
 {
     if (!FillElementPaintBuffer.CacheRelatedPropertyNames.ContainsKey(property.NameHash))
     {
         return;
     }
     this.cachedPrimitiveHash = -1;
 }
Ejemplo n.º 13
0
 public void Add(RadObject d, RadProperty dp)
 {
     if (++DependentList._skipper % (1 + this.Count / 4) == 0)
     {
         this.CleanUpDeadWeakReferences(true);
     }
     this.Add(new Dependent(d, dp));
 }
Ejemplo n.º 14
0
 public void UpdateBindingSourceProperty(RadProperty boundProperty, object newValue)
 {
     if (this.options != PropertyBindingOptions.TwoWay)
     {
         return;
     }
     int num = (int)this.BindingSourceObject.SetValue(this.toProperty, newValue);
 }
Ejemplo n.º 15
0
        internal override RadProperty MapStyleProperty(RadProperty propertyToMap, string settingType)
        {
            RadProperty result;

            RadButtonItem.PropertiesForMapping.TryGetValue(propertyToMap, out result);

            return(result);
        }
 public TreeAnimatedPropertySetting(RadProperty property,
                                    object animationStartValue,
                                    object animationEndValue,
                                    int numFrames,
                                    int interval)
     : base(property, animationStartValue, animationEndValue, numFrames, interval)
 {
 }
Ejemplo n.º 17
0
        private RadProperty GetRadProperty(RadObject component)
        {
            if (radProperty == null)
            {
                radProperty = component.GetRegisteredRadProperty(this.Name);
            }

            return(radProperty);
        }
Ejemplo n.º 18
0
        public override RadProperty MapStyleProperty(
            RadProperty propertyToMap,
            string settingType)
        {
            RadProperty radProperty;

            RadButtonItem.PropertiesForMapping.TryGetValue(propertyToMap, out radProperty);
            return(radProperty);
        }
Ejemplo n.º 19
0
        protected override void PropertySynchronized(RadProperty property)
        {
            PaletteListDataItem dataItem = (PaletteListDataItem)this.Data;

            for (int i = 0; i < boxes.Length; i++)
            {
                boxes[i].BackColor = dataItem.Palette.GlobalEntries[i].Fill;
            }
        }
Ejemplo n.º 20
0
        public void InvalidateFillCache(RadProperty property)
        {
            FillElementPaintBuffer paintBuffer = this.FillElementPaintBuffer;

            if (paintBuffer != null)
            {
                paintBuffer.InvalidateCachedPrimitiveHash(property);
            }
        }
Ejemplo n.º 21
0
        public void InvalidateDependents(RadObject source, RadProperty sourceDP)
        {
            Dependent[] array = this.ToArray();
            int         num   = 0;

            while (num < array.Length)
            {
                ++num;
            }
        }
Ejemplo n.º 22
0
        internal override RadProperty MapStyleProperty(RadProperty propertyToMap, string settingType)
        {
            RadProperty mappedProperty = null;

            if (mappedStyleProperties.TryGetValue(propertyToMap, out mappedProperty))
            {
                return(mappedProperty);
            }
            return(base.MapStyleProperty(propertyToMap, settingType));
        }
Ejemplo n.º 23
0
        protected override void PropertySynchronized(RadProperty property)
        {
            CommandBarStripsListDataItem data = (CommandBarStripsListDataItem)this.Data;

            if (property == CommandBarStripsListDataItem.VisibleProperty || property == CommandBarStripsListDataItem.NameProperty)
            {
                this.checkBox.Checked = data.Visible;
                this.label.Text       = data.Name;
            }
            this.Text = "";
        }
Ejemplo n.º 24
0
 protected override GridEventType GetEventInfo(
     RadProperty property,
     out GridEventDispatchMode dispatchMode)
 {
     if (property != GridViewDataColumn.DataTypeProperty)
     {
         return(base.GetEventInfo(property, out dispatchMode));
     }
     dispatchMode = GridEventDispatchMode.Send;
     return(GridEventType.Both);
 }
Ejemplo n.º 25
0
 protected virtual GridEventType GetEventInfo(
     RadProperty property,
     out GridEventDispatchMode dispatchMode)
 {
     dispatchMode = GridEventDispatchMode.Send;
     if (property == GridViewColumn.AllowGroupProperty)
     {
         return(GridEventType.Data);
     }
     return(property == GridViewColumn.FieldNameProperty || property == GridViewColumn.PinPositionProperty || property == GridViewColumn.ExpressionProperty ? GridEventType.Both : GridEventType.UI);
 }
Ejemplo n.º 26
0
 public RadPropertyBinding(
     RadObject bindingSourceObject,
     RadProperty fromProperty,
     RadProperty bindingSourceProperty,
     PropertyBindingOptions options)
 {
     this.bindingSourceObject = bindingSourceObject;
     this.fromProperty        = fromProperty;
     this.toProperty          = bindingSourceProperty;
     this.options             = options;
 }
Ejemplo n.º 27
0
        public override RadProperty MapStyleProperty(
            RadProperty propertyToMap,
            string settingType)
        {
            RadProperty radProperty = (RadProperty)null;

            if (RadDropDownButtonElement.mappedStyleProperties.TryGetValue(propertyToMap, out radProperty))
            {
                return(radProperty);
            }
            return(base.MapStyleProperty(propertyToMap, settingType));
        }
Ejemplo n.º 28
0
        private void InitializeConverters()
        {
            //call this to let special converters like the one for XmlPropertySetting to get the actual converter from 
            //the actaul serialized RadPoperty
            this.objectType = this.converter.GetActualPropertyType(this.propertyOwner, this.Property);

            //since "Property" attribute carries information how "Value" attribute should be processed, 
            //this fix ensures that order of attributes does not brake the parser
            if (objectType == null)
            {
                if (!shouldWaitForAttribute)
                {
                    shouldWaitForAttribute = true;
                    return;
                }
                else //wait only once
                {
                    throw new InvalidOperationException("Attribute PropertyName of a PropertySetting not found during deserialization.");
                }
            }

            //test if there is RadProperty
            this.radProperty = this.converter.GetRadProperty(this.propertyOwner, this.Property);

            TypeConverter newTypeConverter = null;

            if (this.radProperty != null)
            {
                PropertyDescriptor clrProperty = this.radProperty.FindClrProperty();
                if (clrProperty != null)
                {
                    newTypeConverter = clrProperty.Converter;
                }
            }

            if (newTypeConverter == null)
            {
                newTypeConverter = TypeDescriptor.GetConverter(objectType);
            }

            if (newTypeConverter.CanConvertFrom(typeof(string)) && newTypeConverter.CanConvertTo(typeof(string)))
            {
                this.isSerializedAsString = true;
                this.typeConverter = newTypeConverter;
                //mark to use typeConverter instaed of given converter
                this.converter = null;
            }
            else
            {
                this.isSerializedAsString = false;
            }
        }
Ejemplo n.º 29
0
 protected virtual bool SetSignImage(RadElement element, RadProperty property)
 {
     if (element.GetValueSource(property) == ValueSource.DefaultValue)
     {
         return(false);
     }
     this.SignImage      = (Image)element.GetValue(property);
     this.SignStyle      = SignStyles.Image;
     this.DrawSignBorder = false;
     this.DrawSignFill   = false;
     this.signImageSet   = true;
     return(true);
 }
Ejemplo n.º 30
0
 public ObjectSerializationInfo(ComponentXmlSerializer serializer, Type objectType, object currentValue)
     : this(serializer)
 {
     if (objectType != null)
     {
         this.objectType = objectType;
         this.isSerializedAsString = objectType == typeof(string);
         this.radProperty = null;
         this.currentPropertyValue = currentValue;
     }
     else
     {
         this.isSerializedAsString = false;
     }
 }