[Bind] Enums can now be marked as obsolete

This commit is contained in:
thefiddler 2014-07-21 16:02:18 +02:00
parent ec34d17b21
commit cab9e85386
2 changed files with 4 additions and 0 deletions

View file

@ -505,6 +505,8 @@ namespace Bind
sw.WriteLine("/// </summary>");
}
if (@enum.IsObsolete)
sw.WriteLine("[Obsolete(\"{0}\")]", @enum.Obsolete);
if (@enum.IsFlagCollection)
sw.WriteLine("[Flags]");
sw.WriteLine("public enum " + @enum.Name + " : " + @enum.Type);

View file

@ -353,6 +353,8 @@ namespace Bind
Type = node.GetAttribute("type", String.Empty).Trim()
};
e.Obsolete = node.GetAttribute("obsolete", String.Empty).Trim();
if (String.IsNullOrEmpty(e.Name))
throw new InvalidOperationException(String.Format("Empty name for enum element {0}", node.ToString()));