Beispiel #1
0
        public void Init()
        {
            cssBlockBuilder = new CSSBlockBuilder();

            classTaskPrimarySelection = cssBlockBuilder.Builder.AddClassEntry(nameof(classTaskPrimarySelection))
                                        .Set(cssPropertyEnum.background_color, Color.Orange.ColorToHex(ColorHexFormats.RGB))
                                        .Set(cssPropertyEnum.border, "5px")
                                        .Set(cssPropertyEnum.border_color, Color.Orange.ColorToHex(ColorHexFormats.RGB));


            classTaskSecondarySelection = cssBlockBuilder.Builder.AddClassEntry(nameof(classTaskSecondarySelection))
                                          .Set(cssPropertyEnum.background_color, Color.LightGoldenrodYellow.ColorToHex(ColorHexFormats.RGB))
                                          .Set(cssPropertyEnum.border, "3px")
                                          .Set(cssPropertyEnum.border_color, Color.LightGoldenrodYellow.ColorToHex(ColorHexFormats.RGB));

            classInfoLabel = cssBlockBuilder.Builder.AddClassEntry(nameof(classInfoLabel)).Set(cssPropertyEnum.font_size, 8)
                             .Set(cssPropertyEnum.color, Color.White).Set(cssPropertyEnum.background_color, Color.OrangeRed).Set(cssPropertyEnum.padding, 5);


            classInfoSecondaryLabel = cssBlockBuilder.Builder.AddClassEntry(nameof(classInfoSecondaryLabel)).Set(cssPropertyEnum.font_size, 7)
                                      .Set(cssPropertyEnum.color, Color.White).Set(cssPropertyEnum.background_color, Color.Yellow).Set(cssPropertyEnum.padding, 3);

            cssBlockBuilder.Builder.AddVariation(classTaskPrimarySelection, cssSelectorEnum.hover).Set(cssPropertyEnum.border_color, Color.OrangeRed.ColorToHex(ColorHexFormats.RGB));

            cssEntryDefinition classSourceTableCell = cssBlockBuilder.Builder.AddClassEntry(nameof(classSourceTableCell))
                                                      .Set(cssPropertyEnum.background_color, Color.Green.ColorToHex(ColorHexFormats.RGB))
                                                      .Set(cssPropertyEnum.border, "3px")
                                                      .Set(cssPropertyEnum.border_color, Color.Green.ColorToHex(ColorHexFormats.RGB));

            cssEntryDefinition classSourceTableCellSecondary = cssBlockBuilder.Builder.AddClassEntry(nameof(classSourceTableCellSecondary))
                                                               .Set(cssPropertyEnum.background_color, Color.GreenYellow.ColorToHex(ColorHexFormats.RGB))
                                                               .Set(cssPropertyEnum.border, "2px")
                                                               .Set(cssPropertyEnum.border_color, Color.GreenYellow.ColorToHex(ColorHexFormats.RGB));
        }
Beispiel #2
0
        /// <summary>
        /// Gets the SVG document that represents Dia shape, attached to the shape definition
        /// </summary>
        /// <param name="defaultStyle">The default style.</param>
        /// <returns></returns>
        public Svg.SvgDocument GetSVG(cssEntryDefinition defaultStyle = null)
        {
            SvgDocument svgDocument = new SvgDocument();

            String svgString = svg.OuterXml;

            if (defaultStyle == null)
            {
                defaultStyle = defaultStyleForSVGRender;
            }

            String inlineValue = defaultStyle.ToString(cssEntryDefinition.syntaxFormat.htmlStyleFormatInline);

            svgString = svgString.Replace("fill: default", inlineValue);

            throw new NotImplementedException();

            //svgDocument = SvgDocument.FromSvg<SvgDocument>(svgString);

            //if (svgDocument.Bounds.Left < 0)
            //{
            //    svgDocument.Width = Math.Abs(svgDocument.Bounds.Left) + svgDocument.Width;
            //    svgDocument.X = 0;
            //}

            return(svgDocument);
        }