示例#1
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer, string prefix, FillBase fill)
        {
            base.Serialize(writer, prefix, fill);
            LinearGradientFill c = fill as LinearGradientFill;

            if (c == null || c.StartColor != StartColor)
            {
                writer.WriteValue(prefix + ".StartColor", StartColor);
            }
            if (c == null || c.EndColor != EndColor)
            {
                writer.WriteValue(prefix + ".EndColor", EndColor);
            }
            if (c == null || c.Angle != Angle)
            {
                writer.WriteInt(prefix + ".Angle", Angle);
            }
            if (c == null || FloatDiff(c.Focus, Focus))
            {
                writer.WriteFloat(prefix + ".Focus", Focus);
            }
            if (c == null || FloatDiff(c.Contrast, Contrast))
            {
                writer.WriteFloat(prefix + ".Contrast", Contrast);
            }
        }
示例#2
0
        /// <inheritdoc/>
        public override bool Equals(object obj)
        {
            LinearGradientFill f = obj as LinearGradientFill;

            return(f != null && StartColor == f.StartColor && EndColor == f.EndColor && Angle == f.Angle &&
                   !FloatDiff(Focus, f.Focus) && !FloatDiff(Contrast, f.Contrast));
        }