예제 #1
0
        /// <summary>
        /// Merges the given <see cref="Style"/>'s properties with this <see cref="Style"/>'s properties.
        /// </summary>
        /// <param name="s">The <see cref="Style"/> which contains the properties to be merged.</param>
        public override void MergeWith(Style s)
        {
            if (s != null)
            {
                if (this.IsEmpty)
                {
                    this.CopyFrom(s);
                    return;
                }

                base.MergeWith(s);

                BarStyle barStyle = s as BarStyle;
                if (barStyle != null)
                {
                    if (!barStyle.IsEmpty)
                    {
                        if (!this.IsSet(Prop_BackImageUrl) && barStyle.IsSet(Prop_BackImageUrl))
                        {
                            this.BackImageUrl = barStyle.BackImageUrl;
                        }
                        if (!this.IsSet(Prop_ForeImageUrl) && barStyle.IsSet(Prop_ForeImageUrl))
                        {
                            this.ForeImageUrl = barStyle.ForeImageUrl;
                        }
                    }
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Copies the properties of the given <see cref="Style"/> into this <see cref="Style"/>.
        /// </summary>
        /// <param name="s">The <see cref="Style"/> which contains the properties to be copied.</param>
        public override void CopyFrom(Style s)
        {
            if (s != null)
            {
                base.CopyFrom(s);

                BarStyle barStyle = s as BarStyle;
                if (barStyle != null)
                {
                    if (!barStyle.IsEmpty)
                    {
                        if (barStyle.IsSet(Prop_BackImageUrl))
                        {
                            this.BackImageUrl = barStyle.BackImageUrl;
                        }
                        if (barStyle.IsSet(Prop_ForeImageUrl))
                        {
                            this.ForeImageUrl = barStyle.ForeImageUrl;
                        }
                    }
                }
            }
        }