示例#1
0
        private SDConditionalBlock CreateConditionalBlock(string expression)
        {
            var token = new SDConditionalBlock
            {
                Expression = expression,
                Role = SDNodeRole.Conditional
            };

            return token;
        }
示例#2
0
        private void ParseConditionalMethodBlock(SequenceDiagramComposite composite, SDConditionalBlock conditionalBlock)
        {
            var sequenceDiagramBlock = composite.AddBlock(string.Format("if ({0})", conditionalBlock.Expression));
            foreach (var statement in conditionalBlock.TrueStatements)
            {
                ParseCall(statement, sequenceDiagramBlock);
            }

            if (NodeNotEmpty(conditionalBlock, conditionalBlock.FalseStatements))
            {
                sequenceDiagramBlock = composite.AddBlock("else");
                foreach (var statement in conditionalBlock.FalseStatements)
                {
                    ParseCall(statement, sequenceDiagramBlock);
                }
            }
        }