Opentk/Source/OpenGL/Bind/Structures/Enum.cs

50 lines
1.2 KiB
C#
Raw Normal View History

2006-10-08 18:26:43 +00:00
#region License
//Copyright (c) 2006 Stephen Apostolopoulos
//See license.txt for license info
#endregion
2006-09-28 22:07:53 +00:00
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenTK.OpenGL.Bind
{
#region class Enum
2006-09-28 22:07:53 +00:00
public class Enum
{
string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
System.Collections.Hashtable _constant_collection = new System.Collections.Hashtable();
public System.Collections.Hashtable ConstantCollection
{
get { return _constant_collection; }
set { _constant_collection = value; }
}
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.AppendLine(" public enum " + Name + " : uint");
sb.AppendLine(" {");
foreach (Constant c in ConstantCollection.Values)
{
sb.AppendLine(" " + c.Name + " = " + c.Value + ",");
}
2006-10-10 23:40:36 +00:00
sb.AppendLine(" }");
2006-09-28 22:07:53 +00:00
return sb.ToString();
}
}
#endregion
2006-09-28 22:07:53 +00:00
}