Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImmutableLinearGradientBrush"/> class.
 /// </summary>
 /// <param name="gradientStops">The gradient stops.</param>
 /// <param name="opacity">The opacity of the brush.</param>
 /// <param name="spreadMethod">The spread method.</param>
 /// <param name="startPoint">The start point for the gradient.</param>
 /// <param name="endPoint">The end point for the gradient.</param>
 public ImmutableLinearGradientBrush(
     IList <GradientStop> gradientStops,
     double opacity = 1,
     GradientSpreadMethod spreadMethod = GradientSpreadMethod.Pad,
     RelativePoint?startPoint          = null,
     RelativePoint?endPoint            = null)
     : base(gradientStops, opacity, spreadMethod)
 {
     StartPoint = startPoint ?? RelativePoint.TopLeft;
     EndPoint   = endPoint ?? RelativePoint.BottomRight;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImmutableConicGradientBrush"/> class.
 /// </summary>
 /// <param name="gradientStops">The gradient stops.</param>
 /// <param name="opacity">The opacity of the brush.</param>
 /// <param name="spreadMethod">The spread method.</param>
 /// <param name="center">The center point for the gradient.</param>
 /// <param name="angle">The starting angle for the gradient.</param>
 public ImmutableConicGradientBrush(
     IReadOnlyList <ImmutableGradientStop> gradientStops,
     double opacity = 1,
     GradientSpreadMethod spreadMethod = GradientSpreadMethod.Pad,
     RelativePoint?center = null,
     double angle         = 0)
     : base(gradientStops, opacity, spreadMethod)
 {
     Center = center ?? RelativePoint.Center;
     Angle  = angle;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ImmutableRadialGradientBrush"/> class.
 /// </summary>
 /// <param name="gradientStops">The gradient stops.</param>
 /// <param name="opacity">The opacity of the brush.</param>
 /// <param name="spreadMethod">The spread method.</param>
 /// <param name="center">The start point for the gradient.</param>
 /// <param name="gradientOrigin">
 /// The location of the two-dimensional focal point that defines the beginning of the gradient.
 /// </param>
 /// <param name="radius">
 /// The horizontal and vertical radius of the outermost circle of the radial gradient.
 /// </param>
 public ImmutableRadialGradientBrush(
     IReadOnlyList <ImmutableGradientStop> gradientStops,
     double opacity = 1,
     GradientSpreadMethod spreadMethod = GradientSpreadMethod.Pad,
     RelativePoint?center         = null,
     RelativePoint?gradientOrigin = null,
     double radius = 0.5)
     : base(gradientStops, opacity, spreadMethod)
 {
     Center         = center ?? RelativePoint.Center;
     GradientOrigin = gradientOrigin ?? RelativePoint.Center;
     Radius         = radius;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ImmutableLinearGradientBrush"/> class.
 /// </summary>
 /// <param name="gradientStops">The gradient stops.</param>
 /// <param name="opacity">The opacity of the brush.</param>
 /// <param name="transform">The transform of the brush.</param>
 /// <param name="transformOrigin">The transform origin of the brush</param>
 /// <param name="spreadMethod">The spread method.</param>
 /// <param name="startPoint">The start point for the gradient.</param>
 /// <param name="endPoint">The end point for the gradient.</param>
 public ImmutableLinearGradientBrush(
     IReadOnlyList <ImmutableGradientStop> gradientStops,
     double opacity = 1,
     ImmutableTransform?transform      = null,
     RelativePoint?transformOrigin     = null,
     GradientSpreadMethod spreadMethod = GradientSpreadMethod.Pad,
     RelativePoint?startPoint          = null,
     RelativePoint?endPoint            = null)
     : base(gradientStops, opacity, transform, transformOrigin, spreadMethod)
 {
     StartPoint = startPoint ?? RelativePoint.TopLeft;
     EndPoint   = endPoint ?? RelativePoint.BottomRight;
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImmutableGradientBrush"/> class.
 /// </summary>
 /// <param name="gradientStops">The gradient stops.</param>
 /// <param name="opacity">The opacity of the brush.</param>
 /// <param name="transform">The transform of the brush.</param>
 /// <param name="transformOrigin">The transform origin of the brush</param>
 /// <param name="spreadMethod">The spread method.</param>
 protected ImmutableGradientBrush(
     IReadOnlyList <ImmutableGradientStop> gradientStops,
     double opacity,
     ImmutableTransform?transform,
     RelativePoint?transformOrigin,
     GradientSpreadMethod spreadMethod)
 {
     GradientStops   = gradientStops;
     Opacity         = opacity;
     Transform       = transform;
     TransformOrigin = transformOrigin.HasValue ? transformOrigin.Value : RelativePoint.TopLeft;
     SpreadMethod    = spreadMethod;
 }
 public DropTargetInfo(IDropTarget target, RelativePoint?position, bool canDrop)
 {
     this.Target   = target;
     this.Position = position;
     this.CanDrop  = canDrop;
 }