PrintComments() public static method

public static PrintComments ( string name, string padding ) : IEnumerable
name string
padding string
return IEnumerable
Esempio n. 1
0
        public override string ToUmlCode(int padding = 0)
        {
            string        paddingStr = String.Concat(Enumerable.Repeat(" ", padding));
            List <string> lines      = new List <string> ();

            lines.AddRange(Comments.PrintComments(commentsKey, paddingStr));
            string nameWithPackage = Packages.IsInPackage(name) ? Packages.GetPackage(name) + "." + name : name;

            lines.Add(
                paddingStr + Publicity.ToCode("", " ") + Virtuality.ToCode("", " ") + type.ToCode("", " ")
                + nameWithPackage
                + " : " + string.Join(", ", bases)
                );
            lines.Add(paddingStr + "  Attributes:");
            foreach (IUmlObject obj in Content)
            {
                if (obj is UmlAttribute)
                {
                    lines.Add(obj.ToUmlCode(padding + 4));
                }
            }
            lines.Add(paddingStr + "  Methods:");
            foreach (IUmlObject obj in Content)
            {
                if (!(obj is UmlAttribute))
                {
                    lines.Add(obj.ToUmlCode(padding + 4));
                }
            }
            return(string.Join("\n", lines));
        }
Esempio n. 2
0
        public override string ToUmlCode(int padding = 0)
        {
            string        paddingStr = String.Concat(Enumerable.Repeat(" ", padding));
            List <string> lines      = new List <string> ();

            lines.AddRange(Comments.PrintComments(commentsKey, paddingStr));
            string uml = paddingStr + Publicity.ToUml() + name + " : " + type;

            uml += Virtuality.ToCode(" ", "");
            lines.Add(uml);
            return(string.Join("\n", lines));
        }
Esempio n. 3
0
        public override string ToUmlCode(int padding = 0)
        {
            string        paddingStr = String.Concat(Enumerable.Repeat(" ", padding));
            List <string> lines      = new List <string> ();

            lines.AddRange(Comments.PrintComments(commentsKey, paddingStr));
            string nameWithPackage = Packages.IsInPackage(name) ? Packages.GetPackage(name) + "." + name : name;

            lines.Add(paddingStr + Publicity.ToCode("", " ") + Virtuality.ToCode("", " ") + "enum " + nameWithPackage);
            foreach (string literal in values)
            {
                lines.AddRange(Comments.PrintComments(Comments.Key(name, literal), paddingStr + "    "));
                lines.Add(paddingStr + "    " + literal);
            }
            return(string.Join("\n", lines));
        }