2007-11-10 23:31:01 +00:00
|
|
|
|
#region --- License ---
|
|
|
|
|
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
|
|
|
|
* See license.txt for license info
|
|
|
|
|
*/
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace Examples
|
|
|
|
|
{
|
|
|
|
|
[AttributeUsage(AttributeTargets.Class)]
|
|
|
|
|
public class ExampleAttribute : System.Attribute
|
|
|
|
|
{
|
2008-01-17 14:06:14 +00:00
|
|
|
|
string title;
|
|
|
|
|
public string Title { get { return title; } internal set { title = value; } }
|
2007-11-10 23:31:01 +00:00
|
|
|
|
public readonly ExampleCategory Category;
|
2007-11-11 18:44:10 +00:00
|
|
|
|
public readonly int Difficulty;
|
|
|
|
|
public readonly bool Visible = true;
|
2007-11-10 23:31:01 +00:00
|
|
|
|
|
2007-11-11 18:44:10 +00:00
|
|
|
|
public ExampleAttribute(string title, ExampleCategory category, int difficulty)
|
2007-11-10 23:31:01 +00:00
|
|
|
|
{
|
|
|
|
|
this.Title = title;
|
|
|
|
|
this.Category = category;
|
2007-11-11 18:44:10 +00:00
|
|
|
|
this.Difficulty = difficulty;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ExampleAttribute(string title, ExampleCategory category, int difficulty, bool visible)
|
|
|
|
|
{
|
|
|
|
|
this.Title = title;
|
|
|
|
|
this.Category = category;
|
|
|
|
|
this.Difficulty = difficulty;
|
|
|
|
|
this.Visible = visible;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return String.Format("{0} {1}: {2}", Category, Difficulty, Title);
|
2007-11-10 23:31:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum ExampleCategory
|
|
|
|
|
{
|
|
|
|
|
OpenGL,
|
|
|
|
|
OpenAL,
|
2007-11-11 18:44:10 +00:00
|
|
|
|
Tutorial,
|
2007-11-10 23:31:01 +00:00
|
|
|
|
GLSL,
|
|
|
|
|
WinForms,
|
|
|
|
|
Test,
|
|
|
|
|
}
|
|
|
|
|
}
|