Пример #1
0
        public GradientBuilder AddRadialGradient(Action <RadialGradientBuilder> setup = null)
        {
            var builder = new RadialGradientBuilder();

            setup?.Invoke(builder);

            UseBuilder(builder);
            return(this);
        }
 public IRadialGradient Construct(RadialGradientBuilder builder)
 {
     return(new RadialGradient
     {
         Center = builder.Center,
         Shape = builder.Shape,
         Stretch = builder.Stretch,
         Radius = builder.Radius,
         IsRepeating = builder.IsRepeating,
         Stops = new List <IGradientStop>(builder.Stops)
     });
 }
Пример #3
0
        public RadialGradientBuilder AddRadialGradient(
            Point center,
            RadialGradientShape shape,
            RadialGradientSize size,
            RadialGradientFlags flags = RadialGradientFlags.PositionProportional,
            bool isRepeating          = false)
        {
            var builder = new RadialGradientBuilder
            {
                Center      = center,
                Shape       = shape,
                Size        = size,
                Flags       = flags,
                IsRepeating = isRepeating
            };

            UseBuilder(builder);
            return(builder);
        }