public static ExtractTags ( string &content ) : CSharpUML.Tag[] | ||
content | string | |
Résultat | CSharpUML.Tag[] |
public UmlEnum(Tag tag) : base(tag) { name = tag.Params ["name"]; tag.Content = tag.Content.Replace(" = ", "="); Tag[] literalTags = VSParser.ExtractTags(ref tag.Content, "enumerationLiteral"); List <string> literals = new List <string> (); foreach (Tag literalTag in literalTags) { if (literalTag.Params.ContainsKey("name")) { literals.Add(literalTag.Params ["name"]); } else { Console.WriteLine("weird: " + literalTag.Content); } } values = literals.ToArray(); commentsKey = Comments.Key(name); Packages.AddToCurrentPackage(name); }
public UmlClass(Tag classtag) : base(classtag) { if (classtag.Tagname == "interface") { type = ClassType.Interface; } else { type = ClassType.Class; } Content = ParseContent(classtag).ToArray(); Publicity = Publicity.Public; List <string> _bases = new List <string> (); Tag[] baseclasses = VSParser.ExtractTags(ref classtag.Content, "generalization"); foreach (Tag baseclass in baseclasses) { _bases.Add(baseclass.ParseType()); } Tag[] baseinterfaces = VSParser.ExtractTags(ref classtag.Content, "interfaceRealization"); Console.WriteLine("interfaceRealization: " + name + ": " + classtag.Content); foreach (Tag baseinterface in baseinterfaces) { Console.WriteLine("interfaceRealization: " + name + " <- " + baseinterface.Content); _bases.Add(baseinterface.ParseType()); } bases = _bases.ToArray(); commentsKey = Comments.Key(name); Packages.AddToCurrentPackage(name); }
public UmlMethod(Tag tag, UmlClass classobj) : base(tag) { Tag[] paramtags = VSParser.ExtractTags(ref tag.Content, "parameter"); returntype = "void"; List <string> parameterlist = new List <string> (); foreach (Tag proptag in paramtags) { string type = proptag.ParseType(); if (proptag.Params.ContainsKey("direction") && proptag.Params ["direction"].ToLower() == "return") { returntype = type; } else { if (type == "void") { parameterlist.Add(proptag.Name); } else { parameterlist.Add(type + " " + proptag.Name); } } } parameters = parameterlist.ToArray(); commentsKey = Comments.Key(classobj.Name, name, parameters.Unique() + returntype); }
public IEnumerable <IUmlObject> ParseContent(Tag classtag) { Tag[] proptags = VSParser.ExtractTags(ref classtag.Content, "property"); foreach (Tag proptag in proptags) { yield return(new UmlAttribute(proptag, this)); } Tag[] methtags = VSParser.ExtractTags(ref classtag.Content, "operation"); foreach (Tag methtag in methtags) { yield return(new UmlMethod(methtag, this)); } }