public static Inheritance FromXElement(XElement elem) { string typeName = (string)elem.Attribute("type"); string inheritanceKindStr = (string)elem.Attribute("inheritanceKind"); InheritanceKind kind = ToInheritanceKind(inheritanceKindStr); return(new Inheritance(typeName, kind)); }
static string ToString(InheritanceKind kind) { switch (kind) { case InheritanceKind.Class: return("class"); case InheritanceKind.Protocol: return("protocol"); default: throw new ArgumentOutOfRangeException(nameof(kind)); } }
public Inheritance(string inheritedTypeName, InheritanceKind inheritanceKind) { this.InheritanceKind = inheritanceKind; InheritedTypeName = inheritedTypeName; }