예제 #1
0
파일: DGFReader.cs 프로젝트: ondrej11/o106
        void SetPointStyle(IniFile.Section section, IFigure figure)
        {
            figure.Visible = !section.ReadBool("Hide", false) && section.ReadBool("Visible", true);

            var fillColor = section.ReadColor("FillColor");
            var fillStyle = section.ReadInt("FillStyle");
            var foreColor = section.ReadColor("ForeColor");
            var physicalWidth = section.ReadDouble("PhysicalWidth");
            if (fillStyle == 1)
            {
                fillColor = Colors.Transparent;
            }

            PointStyle pointStyle = new PointStyle()
            {
                Fill = new SolidColorBrush(fillColor),
                Color = foreColor,
                Size = physicalWidth,
                StrokeWidth = 0.7
            };

            figure.Style = drawing.StyleManager.FindExistingOrAddNew(pointStyle);
        }
예제 #2
0
        public virtual void AddDefaultStyles()
        {
            var freePointStyle = new PointStyle()
            {
                Fill = new SolidColorBrush(Color.FromArgb(255, 255, 255, 100))
            };
            var pointOnFigureStyle = new PointStyle()
            {
                Fill = new SolidColorBrush(Color.FromArgb(255, 0, 255, 0))
            };
            var dependentPointStyle = new PointStyle()
            {
                Name = "DependentPointStyle",
                Fill = new SolidColorBrush(Color.FromArgb(200, 192, 192, 192))
            };
            var lineStyle  = new LineStyle();
            var lineStyle2 = new LineStyle()
            {
                Name  = "OtherLine",
                Color = Color.FromArgb(200, 0, 0, 255)
            };
            var shapeWithLineStyle = new ShapeStyle();
            var shapeStyle         = new ShapeStyle()
            {
                Color = Colors.Transparent
            };
            var shapeStyle2 = new ShapeStyle()
            {
                Name  = "OtherShape",
                Color = Colors.Transparent,
                Fill  = new SolidColorBrush(Color.FromArgb(100, 200, 255, 200))
            };
            var hyperLinkStyle = new TextStyle()
            {
                FontSize   = 18,
                FontFamily = new FontFamily("Segoe UI")
            };
            var textStyle = new TextStyle()
            {
                FontSize   = 18,
                FontFamily = new FontFamily("Segoe UI")
            };
            var headerStyle = new TextStyle()
            {
                FontSize   = 40,
                FontFamily = new FontFamily("Segoe UI")
            };

            var newStyles = new IFigureStyle[]
            {
                freePointStyle,
                pointOnFigureStyle,
                dependentPointStyle,
                lineStyle,
                lineStyle2,
                shapeStyle,
                shapeStyle2,
                shapeWithLineStyle,
                textStyle,
                headerStyle,
                hyperLinkStyle,
            };

            list.AddRange(newStyles);

            numDefaultStyles = newStyles.Length;
        }