Beispiel #1
0
 /// <summary>
 /// 公共配置
 /// </summary>
 private void Config(IconBuilder builder)
 {
     ConfigId(builder);
     ConfigType(builder);
     ConfigTheme(builder);
     ConfigSpin(builder);
 }
Beispiel #2
0
 public override FrameworkElement CreateIcon()
 {
     return(IconBuilder.BuildIcon()
            .Polygon(
                new SolidColorBrush(Color.FromArgb(255, 128, 255, 128)),
                new SolidColorBrush(Colors.Black),
                new Point(0.68, 0.98),
                new Point(1.01, 0.63),
                new Point(0.875, 0.166),
                new Point(0.401, 0.055),
                new Point(0.068, 0.409),
                new Point(0.208, 0.874))
            .Line(0.68, 0.98, 1.01, 0.63)
            .Line(1.01, 0.63, 0.875, 0.166)
            .Line(0.875, 0.166, 0.401, 0.055)
            .Line(0.401, 0.055, 0.068, 0.409)
            .Line(0.068, 0.409, 0.208, 0.874)
            .Line(0.208, 0.874, 0.68, 0.98)
            .Point(0.68, 0.98)
            .Point(1.01, 0.63)
            .Point(0.875, 0.166)
            .Point(0.401, 0.055)
            .DependentPoint(0.068, 0.409)
            .Point(0.208, 0.874)
            .DependentPoint(0.55, 0.5)
            .Canvas);
 }
Beispiel #3
0
        public override FrameworkElement CreateIcon()
        {
            double a = 0.2, b = 0.4, c = 0.6, d = 0.8;

            return(IconBuilder.BuildIcon()
                   .Polygon(
                       Factory.CreateLinearGradient(
                           Color.FromArgb(255, 200, 255, 0),
                           Color.FromArgb(255, 255, 255, 0),
                           90),
                       new SolidColorBrush(Colors.Black),
                       new Point(a, b),
                       new Point(b, b),
                       new Point(b, a),
                       new Point(c, a),
                       new Point(c, b),
                       new Point(d, b),
                       new Point(d, c),
                       new Point(c, c),
                       new Point(c, d),
                       new Point(b, d),
                       new Point(b, c),
                       new Point(a, c))
                   .Canvas);
        }
Beispiel #4
0
        /// <summary>
        /// 获取标签生成器
        /// </summary>
        protected override TagBuilder GetTagBuilder()
        {
            var result = new IconBuilder();

            Config(result);
            return(result);
        }
Beispiel #5
0
        /// <summary>
        /// 获取Material图标标签生成器
        /// </summary>
        private IconBuilder GetMaterialIconBuilder()
        {
            var builder = new IconBuilder();

            builder.SetContent(_config.GetValue <MaterialIcon>(UiConst.MaterialIcon).Description());
            return(builder);
        }
 public override FrameworkElement CreateIcon()
 {
     return(IconBuilder.BuildIcon()
            .Line(0.25, 0.75, 0.75, 0.25)
            .Polygon(Brushes.Black, Brushes.Black, new Point(0.75, 0.25), new Point(0.5, 0.4), new Point(0.6, 0.5))
            .Canvas);
 }
 public override FrameworkElement CreateIcon()
 {
     return(IconBuilder.BuildIcon()
            .Line(0.25, 0.75, 0.75, 0.25)
            .Point(0.25, 0.75)
            .Point(0.75, 0.25)
            .Canvas);
 }
Beispiel #8
0
 public override FrameworkElement CreateIcon()
 {
     return(IconBuilder.BuildIcon()
            .Line(0, 0.7, 0.7, 0)
            .Line(0.3, 1, 1, 0.3)
            .Point(0.35, 0.35)
            .Canvas);
 }
 public override FrameworkElement CreateIcon()
 {
     return(IconBuilder.BuildIcon()
            .Circle(0.5, 0.5, 0.5)
            .Point(0.5, 0.5)
            .Point(0.85, 0.15)
            .Canvas);
 }
Beispiel #10
0
        /// <summary>
        /// 添加布尔值
        /// </summary>
        private void AddBoolType(TagBuilder builder, string value)
        {
            var checkIconBuilder = new IconBuilder().AddType(AntDesignIcon.Check.Description()).AddAttribute("*ngIf", $"{value}");

            builder.AppendContent(checkIconBuilder);
            var clearIconBuilder = new IconBuilder().AddType(AntDesignIcon.Close.Description()).AddAttribute("*ngIf", $"!({value})");

            builder.AppendContent(clearIconBuilder);
        }
Beispiel #11
0
 public override FrameworkElement CreateIcon()
 {
     return(IconBuilder.BuildIcon()
            .Ellipse(0.5, 0.5, 0.5, 0.3)
            .Point(0.5, 0.5)
            .Point(1.0, 0.5)
            .Point(0.5, 0.2)
            .Canvas);
 }
Beispiel #12
0
        public override FrameworkElement CreateIcon()
        {
            const double r = 0.4;

            return(IconBuilder.BuildIcon()
                   .Arc(0.5, 0.5, 0.5 + r, 0.5, 0.5, 0.5 - r)
                   .Point(0.5, 0.5 - r)
                   .Point(0.5, 0.5)
                   .Point(0.5 + r, 0.5)
                   .Canvas);
        }
Beispiel #13
0
        /// <summary>
        /// 配置图标
        /// </summary>
        private void ConfigIcon(TagBuilder builder)
        {
            if (_config.Contains(UiConst.Icon) == false)
            {
                return;
            }
            var iconBuilder = new IconBuilder();

            iconBuilder.AddType(_config.GetValue <AntDesignIcon?>(UiConst.Icon)?.Description());
            builder.AppendContent(iconBuilder);
        }
 public override FrameworkElement CreateIcon()
 {
     return(IconBuilder
            .BuildIcon()
            .Polygon(
                Factory.CreateDefaultFillBrush(),
                new SolidColorBrush(Colors.Black),
                new Point(0.35, 0.0),
                new Point(0.0, 1.0),
                new Point(0.7, 1.0))
            .Canvas);
 }
        public override FrameworkElement CreateIcon()
        {
            const double r = 0.4;

            return(IconBuilder.BuildIcon()
                   .Circle(r, r, r)
                   .Line(0.5, 0.9, 0.5 + r, 0.9)
                   .Point(r, r)
                   .Point(0.5, 0.9)
                   .Point(0.5 + r, 0.9)
                   .Canvas);
        }
        /// <summary>
        /// 配置按钮图标
        /// </summary>
        private void ConfigButtonIcon(ButtonWrapperBuilder buttonBuilder)
        {
            var iconBuilder = new IconBuilder();

            buttonBuilder.AppendContent(iconBuilder);
            if (_config.Contains(UiConst.ButtonIcon))
            {
                iconBuilder.AddType(_config.GetValue <AntDesignIcon?>(UiConst.ButtonIcon)?.Description());
                return;
            }
            iconBuilder.AddType(AntDesignIcon.Upload.Description());
        }
Beispiel #17
0
 public override FrameworkElement CreateIcon()
 {
     return(IconBuilder.BuildIcon()
            .Bezier(0, 0.75, 0, 0, 0.5, 1, 1, 0)
            //.Line(0, 0, 0, 0.75)
            //.Line(0.5, 1, 1, 0)
            //.Point(0, 0)
            //.Point(0, 0.75)
            //.Point(1, 0)
            //.Point(0.5, 1)
            .Canvas);
 }
Beispiel #18
0
        public override FrameworkElement CreateIcon()
        {
            const double a = 0.4;   // semi-major
            const double b = 0.8;   // semi-minor
            var          s = new Size(a, b);

            return(IconBuilder.BuildIcon()
                   .EllipseArc(0.5, 0.9, 0.5 + a, 0.9, 0.5, 0.9 - b, s, 0)
                   .Point(0.5, 0.9)
                   .Point(0.5 + a, 0.9)
                   .Point(0.5, 0.9 - b)
                   .Canvas);
        }
        public override FrameworkElement CreateIcon()
        {
            double sideLength = 1.0;

            return(IconBuilder
                   .BuildIcon()
                   .Polygon(
                       Factory.CreateDefaultFillBrush(),
                       new SolidColorBrush(Colors.Black),
                       new Point(sideLength / 2, 0.0),
                       new Point(0.0, Math.SquareRoot(3) * sideLength / 2),
                       new Point(sideLength, Math.SquareRoot(3) * sideLength / 2))
                   .Canvas);
        }
Beispiel #20
0
        public override FrameworkElement CreateIcon()
        {
            const double a = 0.9, b = 0.1;
            var          builder = IconBuilder.BuildIcon()
                                   .Line(a, a, b, a)
                                   .Line(b, a, b, b)
                                   .Line(a, b, b, a)
                                   .Arc(b, a, 0.4, a, b, 0.6)
                                   .Point(a, a)
                                   .Point(b, a)
                                   .Point(b, b);

            return(builder.Canvas);
        }
 public override FrameworkElement CreateIcon()
 {
     return(IconBuilder.BuildIcon()
            .Line(0.5, 0, 0.5, 1)
            .Polygon(
                new SolidColorBrush(Colors.Yellow),
                new SolidColorBrush(Colors.Black),
                new Point(0.4, 0.2),
                new Point(0.4, 0.9),
                new Point(0, 0.9))
            .Polygon(
                new SolidColorBrush(Color.FromArgb(255, 128, 255, 128)),
                new SolidColorBrush(Colors.Black),
                new Point(0.6, 0.2),
                new Point(0.6, 0.9),
                new Point(1, 0.9))
            .Canvas);
 }
Beispiel #22
0
 public override FrameworkElement CreateIcon()
 {
     return(IconBuilder.BuildIcon()
            .Point(0.1, 0.9)
            .Polygon(
                new SolidColorBrush(Colors.Yellow),
                new SolidColorBrush(Colors.Black),
                new Point(0.3, 0.9),
                new Point(0.9, 0.9),
                new Point(0.9, 0.6))
            .Polygon(
                new SolidColorBrush(Color.FromArgb(255, 128, 255, 128)),
                new SolidColorBrush(Colors.Black),
                new Point(0.24, 0.06),
                new Point(0.5, 0.21),
                new Point(0.2, 0.73))
            .Canvas);
 }
Beispiel #23
0
        public override FrameworkElement CreateIcon()
        {
            double a = 0.2, b = 0.8;

            return(IconBuilder.BuildIcon()
                   .Polygon(
                       new SolidColorBrush(Color.FromArgb(255, 128, 255, 128)),
                       new SolidColorBrush(Colors.Black),
                       new Point(a, a),
                       new Point(b, a),
                       new Point(b, b),
                       new Point(a, b))
                   .Line(a, a, b, a)
                   .Line(b, a, b, b)
                   .Line(b, b, a, b)
                   .Line(a, b, a, a)
                   .DependentPoint(a, a)
                   .DependentPoint(b, a)
                   .Point(b, b)
                   .Point(a, b)
                   .Canvas);
        }
Beispiel #24
0
        public override FrameworkElement CreateIcon()
        {
            var builder = IconBuilder.BuildIcon();
            var size    = IconBuilder.IconSize;
            var centerX = (size - 4) / (2 * size);
            var centerY = 1 - 4 / size;

            builder.Line(centerX, centerY, 0.8, 0.2)
            .Line(centerX, centerY, 1, centerY);

            var xaml = string.Format(@"
  <Path xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
    Stroke='Black'
    StrokeThickness='1'
    Fill='#33FF33'
    Data='m 0,{0} v-4 a {1},{1} 0 0 1 {2},0 v4 z m {4},-5 a 6,6 0 0 1 {3},0 z'
  />", size, (size - 4) / 2, size - 4, size / 2, (size - 4) / 4 - 1);

#if SILVERLIGHT
            var path = XamlReader.Load(xaml) as Path;
#else
            var path = XamlReader.Parse(xaml) as Path;
#endif
            builder.Canvas.Children.Add(path);

            var radius      = ((size - 4) / 2) * 0.95;
            var radiusSmall = radius * 0.8;
            var center      = new Point(radius + 1, size - 4);
            for (double i = 0; i < 16; i++)
            {
                var angle = i * Math.PI / 15;
                builder.Line((center.X + radius * M.Cos(angle)) / size,
                             (center.Y - radius * M.Sin(angle)) / size,
                             (center.X + radiusSmall * M.Cos(angle)) / size,
                             (center.Y - radiusSmall * M.Sin(angle)) / size);
            }

            return(builder.Canvas);
        }
        public override FrameworkElement CreateIcon()
        {
            var builder = IconBuilder
                          .BuildIcon()
                          .Polygon(
                new SolidColorBrush(Colors.Yellow),
                new SolidColorBrush(Colors.Black),
                new Point(0.1, 0.8),
                new Point(0.3, 1),
                new Point(1, 0.3),
                new Point(0.8, 0.1))
                          .Line(0, 0.7, 0.7, 0);

            for (var i = 0.2; i <= 0.7; i += 0.1)
            {
                builder.Line(i, 0.9 - i, i + 0.1, 1 - i);
            }
            for (var i = 0.15; i <= 0.75; i += 0.1)
            {
                builder.Line(i, 0.9 - i, i + 0.05, 0.95 - i);
            }
            return(builder.Canvas);
        }
Beispiel #26
0
        public override FrameworkElement CreateIcon()
        {
            Point[] points =
            {
                new Point(10,  5),
                new Point(10, 21),
                new Point(14, 17),
                new Point(18, 25),
                new Point(19, 25),
                new Point(20, 24),
                new Point(17, 17),
                new Point(17, 16),
                new Point(21, 16),
                new Point(10, 5)
            };
            var builder = IconBuilder.BuildIcon();
            var polygon = builder.AddPolygon(
                points.Select(p => new Point(p.X / 32, p.Y / 32)));

            polygon.Fill   = new SolidColorBrush(Colors.White);
            polygon.Stroke = new SolidColorBrush(Colors.Black);
            return(builder.Canvas);
        }
        public override FrameworkElement CreateIcon()
        {
            var result = IconBuilder
                         .BuildIcon()
                         .Polygon(
                new SolidColorBrush(Color.FromArgb(255, 255, 200, 200)),
                new SolidColorBrush(Colors.Black),
                new Point(0.2, 0.4),
                new Point(0.3, 0.8),
                new Point(0.7, 0.8),
                new Point(0.8, 0.4),
                new Point(0.6, 0.2));
            var text = new TextBlock()
            {
                Text = "S²"
            };
            var canvas = result.Canvas;

            canvas.Children.Add(text);
            Canvas.SetLeft(text, canvas.Width / 2.0 - text.ActualWidth / 2.0);
            Canvas.SetTop(text, canvas.Height / 2.0 - text.ActualHeight / 2.0);
            return(canvas);
        }
Beispiel #28
0
 /// <summary>
 /// 配置图标类型
 /// </summary>
 private void ConfigType(IconBuilder builder)
 {
     builder.AddType(_config.GetValue <AntDesignIcon?>(UiConst.Type)?.Description());
     builder.AddBindType(_config.GetValue(AngularConst.BindType));
 }