public override bool BuildClass(Project project, Class @class)
        {
            @class.ClassName = this.Identifier.Symbol;
//            @class.BaseClassName = this.Classbaseopt.Symbol.GetClassName();
            try
            {
                project.AddClass(@class);
            }
            catch (Exception e)
            {
                throw new SyntaxException(e.Message, this.Identifier.Line, this.Identifier.Column);
            }

            return(base.BuildClass(project, @class));
        }
Beispiel #2
0
        public void AddDiagram(ClassStructure structure)
        {
            ClassDiagramNode node = new ClassDiagramNode(structure, new BasicNodeStructure(structure.Position, 0, Renderer.SingleTextHeight), RectangleRenderElementStyle.Classes);

            node.AddNode(new PropertyNode(new PropertyStructure(Vector.Zero, "Prop", "Type", AccessModifiers.Public, Modifiers.None), new BasicNodeStructure(Vector.Zero, 0, Renderer.SingleTextHeight), RectangleRenderElementStyle.Textbox));
            node.AddNode(new MethodNode(new MethodStructure(Vector.Zero, "Method", "Type", "Name : Type", AccessModifiers.Public, Modifiers.None), new BasicNodeStructure(Vector.Zero, 0, Renderer.SingleTextHeight), RectangleRenderElementStyle.Textbox));
            if (!Project.Classes.Contains(structure))
            {
                Project.AddClass(structure);
            }
            Children.Add(node);
            node.OnRemoval   += (sender, args) => RemoveDiagram((ClassDiagramNode)args.Node);
            node.OnFocused   += OnNodeFocus;
            node.OnUnfocused += OnNodeUnfocus;
            node.Position     = new Vector(node.Position.X - (node.Width / 2), node.Position.Y - (node.Height / 2));
        }
Beispiel #3
0
 private void mnuNewClass_Click(object sender, EventArgs e)
 {
     project.AddClass();
 }