Exemple #1
0
 public UMLSequenceConnection(UMLSequenceLifeline from, UMLSequenceLifeline to, int lineNumber) : base(lineNumber)
 {
     From     = from;
     To       = to;
     ToName   = string.Empty;
     FromName = string.Empty;
 }
Exemple #2
0
 public UMLSequenceConnection(UMLSequenceLifeline from, UMLSignature action, int lineNumber) : base(lineNumber)
 {
     From     = from;
     Action   = action;
     ToName   = string.Empty;
     FromName = string.Empty;
 }
Exemple #3
0
        public async Task SequenceDiagramRead2()
        {
            UMLInterface i1     = new("ns1", "i1", new List <UMLDataType>());
            UMLClass     class2 = new("", "ns2", true, "c1", null, i1);

            i1.Methods.Add(new UMLMethod("Method1", new VoidDataType(), UMLVisibility.Public, new UMLParameter("parm1", new StringDataType())));
            class2.Methods.Add(new UMLMethod(class2, UMLVisibility.Public));

            class2.Methods.Add(new UMLMethod("Method1", new IntDataType(), UMLVisibility.Public, new UMLParameter("parm1", new StringDataType())));

            UMLClassDiagram cd = new("a", "");

            cd.DataTypes.Add(i1);
            cd.DataTypes.Add(class2);

            UMLSequenceDiagram d = new("my diagram", "");

            UMLSequenceLifeline l1 = new UMLSequenceLifeline("participant", "i1", "ss", i1.Id, 1);
            UMLSequenceLifeline l2 = new UMLSequenceLifeline("participant", "c1", "cS", class2.Id, 2);

            d.LifeLines.Add(l1);
            d.LifeLines.Add(l2);

            d.AddConnection(null, l1, 3).Action = i1.Methods[0];

            UMLSequenceBlockSection pg = new UMLSequenceBlockSection("if z = 1", UMLSequenceBlockSection.SectionTypes.If, 4);

            d.Entities.Add(pg);

            pg.AddConnection(l1, l2, 5).Action = class2.Methods[0];

            UMLSequenceBlockSection elsesection = new UMLSequenceBlockSection("else", UMLSequenceBlockSection.SectionTypes.Else, 6);

            elsesection.AddConnection(l2, l2, 7).Action = class2.Methods[1];

            UMLSequenceConnection x = d.AddConnection(l2, l1, 8);

            x.Action = new UMLReturnFromMethod(class2.Methods[0]);

            UMLSequenceConnection x2 = d.AddConnection(l1, l1, 9);

            x2.Action = i1.Methods[0];

            d.AddConnection(l1, null, 10).Action = new UMLReturnFromMethod(i1.Methods[0]);

            string s = PlantUMLGenerator.Create(d);

            _ = await UMLSequenceDiagramParser.ReadString(s, new LockedList <UMLClassDiagram>(new[] { cd }), false);
        }
Exemple #4
0
        public void SequenceDiagram1()
        {
            UMLInterface i1     = new("ns1", "i1", new List <UMLDataType>());
            UMLClass     class2 = new("", "ns2", true, "c1", null, i1);

            i1.Methods.Add(new UMLMethod("Method1", new VoidDataType(), UMLVisibility.Public, new UMLParameter("parm1", new StringDataType())));
            class2.Methods.Add(new UMLMethod(class2, UMLVisibility.Public));

            class2.Methods.Add(new UMLMethod("Method1", new IntDataType(), UMLVisibility.Public, new UMLParameter("parm1", new StringDataType())));

            UMLSequenceDiagram d = new("my diagram", "");

            UMLSequenceLifeline l1 = new UMLSequenceLifeline("participant", "i1", "i1a", i1.Id, 1);
            UMLSequenceLifeline l2 = new UMLSequenceLifeline("participant", "c2", "c2a", class2.Id, 2);

            d.LifeLines.Add(l1);
            d.LifeLines.Add(l2);

            d.AddConnection(null, l1, 3).Action = i1.Methods[0];
            d.AddConnection(l1, l2, 4).Action   = class2.Methods[0];
            d.AddConnection(l2, l1, 5).Action   = new UMLReturnFromMethod(class2.Methods[0]);
            d.AddConnection(l1, null, 6).Action = new UMLReturnFromMethod(i1.Methods[0]);
            _ = PlantUMLGenerator.Create(d);
        }