/// <inheritdoc/> public override SolidColorBrush Convert( SolidColorBrush initialBrush, SolidColorBrush mixedBrush, ConverterParam <double> lightenOpacityParam) { if (initialBrush == null || mixedBrush == null) { return(null); } var lightenOpacity = lightenOpacityParam.Value; if (lightenOpacity <= 0 || lightenOpacity >= 1) { throw new ArgumentOutOfRangeException( nameof(lightenOpacity), lightenOpacity, @"The mixin opacity value must be >= 0 and <= 1"); } return(BrushExtensions.Blend( initialBrush, mixedBrush, lightenOpacity)); }
public override double Convert( IconFlip iconFlip, ConverterParam <string> propertyParam) { var x = 0; var y = 0; switch (iconFlip) { case IconFlip.None: { x = 1; y = 1; break; } case IconFlip.Horizontal: { x = -1; y = 1; break; } case IconFlip.Vertial: { x = 1; y = -1; break; } case IconFlip.Both: { x = -1; y = -1; break; } default: throw new ArgumentOutOfRangeException(); } switch (propertyParam.Value) { case "X": return(x); case "Y": return(y); default: throw new ArgumentOutOfRangeException(); } }
public override RectangleGeometry Convert( double width, double height, ConverterParam <double> corner) { return(new RectangleGeometry( new Rect( 0, 0, width, height)) { RadiusX = corner.Value, RadiusY = corner.Value }); }
/// <inheritdoc/> public override SolidColorBrush Convert( SolidColorBrush initialBrush, ConverterParam <double> darkenOpacityParam) { var darkenOpacity = darkenOpacityParam.Value; if (darkenOpacity <= 0 || darkenOpacity >= 1) { throw new ArgumentOutOfRangeException( nameof(darkenOpacity), darkenOpacity, @"The darken opacity value must be >= 0 and <= 1"); } return(BrushExtensions.Darken( initialBrush, darkenOpacity)); }
public override Rect Convert( double width, double height, double cornerRadius, Thickness padding, ConverterParam <bool> shouldDisable) { var farPoint = new Point( Math.Max(0, width), Math.Max(0, height)); farPoint.Offset( padding.Left + padding.Right, padding.Top + padding.Bottom); return(new Rect( new Point(), new Point(farPoint.X, farPoint.Y))); }
public override RectangleGeometry Convert( double width, double height, double cornerRadius, ConverterParam <bool> shouldDisable) { var effectRadius = shouldDisable.Value ? 0 : cornerRadius; return(new RectangleGeometry( new Rect( 0, 0, width, height)) { RadiusX = effectRadius, RadiusY = effectRadius }); }
public override double Convert( double width, double height, Point cursorPosition, ConverterParam <double> scaleParameter) { var effectiveRippleCoverWidth = cursorPosition.X < width / 2 ? width - cursorPosition.X : cursorPosition.X; var effectiveRippleCoverHeight = cursorPosition.Y < height / 2 ? height - cursorPosition.Y : cursorPosition.Y; var radius = (effectiveRippleCoverWidth.Squared() + effectiveRippleCoverHeight.Squared()) .Root(); return(radius * scaleParameter.Value); }
public override double Convert(double value, ConverterParam <double> param) { return(value * param.Value); }
void ConvertDelhiBulk() { { ConverterParam p1 = new ConverterParam(); p1.filesToConvert = Directory.GetFiles(textBox1.Text); p1.start = 0; p1.end = 250; Thread tb1 = new Thread(new ParameterizedThreadStart(ConvertPartialSetOfFiles)); tb1.Start(p1); } { ConverterParam p2 = new ConverterParam(); p2.filesToConvert = Directory.GetFiles(textBox1.Text); p2.start = 251; p2.end = 500; Thread tb2 = new Thread(new ParameterizedThreadStart(ConvertPartialSetOfFiles)); tb2.Start(p2); } { ConverterParam p3 = new ConverterParam(); p3.filesToConvert = Directory.GetFiles(textBox1.Text); p3.start = 501; p3.end = 750; Thread tb3 = new Thread(new ParameterizedThreadStart(ConvertPartialSetOfFiles)); tb3.Start(p3); } { ConverterParam p4 = new ConverterParam(); p4.filesToConvert = Directory.GetFiles(textBox1.Text); p4.start = 751; p4.end = 1000; Thread tb4 = new Thread(new ParameterizedThreadStart(ConvertPartialSetOfFiles)); tb4.Start(p4); } { ConverterParam p5 = new ConverterParam(); p5.filesToConvert = Directory.GetFiles(textBox1.Text); p5.start = 1001; p5.end = 1278; Thread tb5 = new Thread(new ParameterizedThreadStart(ConvertPartialSetOfFiles)); tb5.Start(p5); } }