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 static CarouselPathAnimationData GetItemAnimationData(
            RadObject element)
        {
            CarouselPathAnimationData pathAnimationData = (CarouselPathAnimationData)element.GetValue(CarouselItemsContainer.CarouselAnimationData);

            if (pathAnimationData == null)
            {
                pathAnimationData = new CarouselPathAnimationData();
                int num = (int)element.SetValue(CarouselItemsContainer.CarouselAnimationData, (object)pathAnimationData);
            }
            return(pathAnimationData);
        }
示例#3
0
        private static CarouselPathAnimationData GetItemAnimationData(RadObject element)
        {
            CarouselPathAnimationData data =
                (CarouselPathAnimationData)element.GetValue(CarouselItemsContainer.CarouselAnimationData);

            if (data == null)
            {
                data = new CarouselPathAnimationData();
                element.SetValue(CarouselItemsContainer.CarouselAnimationData, data);
            }

            return(data);
        }
示例#4
0
        public override bool ShouldSerializeValue(object component)
        {
            bool?res = GetShouldSerializeFromRadobject(component);

            if (res != null && res.HasValue)
            {
                return(res.Value);
            }

            RadObject        radObject = (RadObject)component;
            RadProperty      property  = this.GetRadProperty(radObject);
            RadPropertyValue propVal   = radObject.GetPropertyValue(property);

            //no entry registered for this RadProperty
            if (propVal == null)
            {
                return(false);
            }

            //TODO: Research why the DefaultValueOverride is part of this condition?
            if (propVal.ValueSource == ValueSource.Local || propVal.ValueSource == ValueSource.LocalFromBinding)
            {
                if (property == RadElement.BoundsProperty)
                {
                    return((bool)radObject.GetValue(RadElement.AutoSizeProperty) == false);
                }

                if (propVal.IsSetAtDesignTime)
                {
                    return(true);
                }

                return(Wrapped.ShouldSerializeValue(component));
            }

            //do not serialize value
            return(false);
        }