[Bind] Enums can now be marked as obsolete
authorthefiddler <stapostol@gmail.com>
Mon, 21 Jul 2014 14:02:18 +0000 (16:02 +0200)
committerthefiddler <stapostol@gmail.com>
Mon, 21 Jul 2014 14:02:18 +0000 (16:02 +0200)
Source/Bind/CSharpSpecWriter.cs
Source/Bind/XmlSpecReader.cs

index 248c6c6..d083996 100644 (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);
index e98e8f3..6bb8a17 100644 (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()));