/// <summary>
        /// Creates a <see cref="BpmnDiagram"/>.
        /// </summary>
        /// <param name="xNode">The XML node to start with</param>
        /// <returns>The parsed <see cref="BpmnDiagram"/></returns>
        private BpmnDiagram BuildDiagram(XElement xNode)
        {
            var diagram = new BpmnDiagram(xNode);

            var bpmnPlane = BuildPlane(BpmnNM.GetElement(xNode, BpmnNM.BpmnDi, BpmnDiConstants.BpmnPlaneElement));

            if (bpmnPlane != null)
            {
                diagram.AddPlane(bpmnPlane);
            }

            foreach (var xChild in BpmnNM.GetElements(xNode, BpmnNM.BpmnDi, BpmnDiConstants.BpmnLabelStyleElement))
            {
                var style = new BpmnLabelStyle(xChild);
                diagram.AddStyle(style);
            }

            // Setting a default LabelStyle for all labels that do not have their own style.
            diagram.DefaultStyle = BpmnLabelStyle.NewDefaultInstance();

            return(diagram);
        }
Esempio n. 2
0
 /// <summary>
 /// Adds a LabelStyle to the collection of styles in this diagram
 /// </summary>
 /// <param name="style">The <see cref="BpmnLabelStyle"/> to add</param>
 public void AddStyle(BpmnLabelStyle style)
 {
     Styles.Add(style.Id, style);
 }