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."); }
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); }
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)); }
public CollapsiblePanelMouseEventsStateManagerFactory( RadProperty expandDirectionProperty, RadProperty isExpandedProperty) { this.expandDirectionProperty = expandDirectionProperty; this.isExpandedProperty = isExpandedProperty; }
public RadCollapsiblePanelElementStateManagerFactory( RadProperty expandDirectionProperty, RadProperty isExpandedProperty) { this.expandDirectionProperty = expandDirectionProperty; this.isExpandedProperty = isExpandedProperty; }
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)); }
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)); } } }
public void InvalidateCachedPrimitiveHash(RadProperty property) { if (CacheRelatedPropertyNames.ContainsKey(property.NameHash)) { this.cachedPrimitiveHash = -1; } }
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); }
public void InvalidateCachedPrimitiveHash(RadProperty property) { if (!FillElementPaintBuffer.CacheRelatedPropertyNames.ContainsKey(property.NameHash)) { return; } this.cachedPrimitiveHash = -1; }
public void Add(RadObject d, RadProperty dp) { if (++DependentList._skipper % (1 + this.Count / 4) == 0) { this.CleanUpDeadWeakReferences(true); } this.Add(new Dependent(d, dp)); }
public void UpdateBindingSourceProperty(RadProperty boundProperty, object newValue) { if (this.options != PropertyBindingOptions.TwoWay) { return; } int num = (int)this.BindingSourceObject.SetValue(this.toProperty, newValue); }
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) { }
private RadProperty GetRadProperty(RadObject component) { if (radProperty == null) { radProperty = component.GetRegisteredRadProperty(this.Name); } return(radProperty); }
public override RadProperty MapStyleProperty( RadProperty propertyToMap, string settingType) { RadProperty radProperty; RadButtonItem.PropertiesForMapping.TryGetValue(propertyToMap, out radProperty); return(radProperty); }
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; } }
public void InvalidateFillCache(RadProperty property) { FillElementPaintBuffer paintBuffer = this.FillElementPaintBuffer; if (paintBuffer != null) { paintBuffer.InvalidateCachedPrimitiveHash(property); } }
public void InvalidateDependents(RadObject source, RadProperty sourceDP) { Dependent[] array = this.ToArray(); int num = 0; while (num < array.Length) { ++num; } }
internal override RadProperty MapStyleProperty(RadProperty propertyToMap, string settingType) { RadProperty mappedProperty = null; if (mappedStyleProperties.TryGetValue(propertyToMap, out mappedProperty)) { return(mappedProperty); } return(base.MapStyleProperty(propertyToMap, settingType)); }
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 = ""; }
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); }
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); }
public RadPropertyBinding( RadObject bindingSourceObject, RadProperty fromProperty, RadProperty bindingSourceProperty, PropertyBindingOptions options) { this.bindingSourceObject = bindingSourceObject; this.fromProperty = fromProperty; this.toProperty = bindingSourceProperty; this.options = options; }
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)); }
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; } }
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); }
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; } }