Make ExampleAttribute.Visible a named parameter, that is true by default (even for test examples).

This commit is contained in:
the_fiddler 2008-05-04 16:32:11 +00:00
parent a8eafbd367
commit 5dbf0c100b
4 changed files with 5 additions and 4 deletions

View file

@ -14,10 +14,11 @@ namespace Examples
public class ExampleAttribute : System.Attribute
{
string title;
bool visible = true;
public string Title { get { return title; } internal set { title = value; } }
public readonly ExampleCategory Category;
public readonly int Difficulty;
public readonly bool Visible = true;
public bool Visible { get { return visible; } set { visible = value; } }
public ExampleAttribute(string title, ExampleCategory category)
: this(title, category, 0, true) { }

View file

@ -108,7 +108,7 @@ namespace Examples
////sb.Append(type.Name);
//sb.Append(example.Title);
if (example.Visible && example.Category != ExampleCategory.Test)
if (example.Visible)
listBox1.Items.Add(new ExampleInfo(type, example));
else
{

View file

@ -17,7 +17,7 @@ using OpenTK.Input;
namespace Examples.Tests
{
[Example("GameWindow states.", ExampleCategory.Test)]
[Example("GameWindow states", ExampleCategory.Test)]
public class GameWindowStates : GameWindow
{
TextureFont font = new TextureFont(new Font(FontFamily.GenericSansSerif, 16.0f));

View file

@ -12,7 +12,7 @@ using OpenTK.Math;
namespace Examples.Tests
{
[Example("Math speed test", ExampleCategory.Test)]
[Example("Math speed test", ExampleCategory.Test, Visible = false)]
public class MathSpeed
{
public static void Main()