2007-11-11 00:31:01 +01:00
|
|
|
|
#region --- License ---
|
2008-01-19 16:25:51 +01:00
|
|
|
|
/* Copyright (c) 2006-2008 the OpenTK team
|
|
|
|
|
* See license.txt for licensing details
|
2007-11-11 00:31:01 +01:00
|
|
|
|
*/
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace Examples
|
|
|
|
|
{
|
|
|
|
|
[AttributeUsage(AttributeTargets.Class)]
|
|
|
|
|
public class ExampleAttribute : System.Attribute
|
|
|
|
|
{
|
2008-01-17 15:06:14 +01:00
|
|
|
|
string title;
|
|
|
|
|
public string Title { get { return title; } internal set { title = value; } }
|
2007-11-11 00:31:01 +01:00
|
|
|
|
public readonly ExampleCategory Category;
|
2007-11-11 19:44:10 +01:00
|
|
|
|
public readonly int Difficulty;
|
|
|
|
|
public readonly bool Visible = true;
|
2007-11-11 00:31:01 +01:00
|
|
|
|
|
2008-01-18 14:59:26 +01:00
|
|
|
|
public ExampleAttribute(string title, ExampleCategory category)
|
|
|
|
|
: this(title, category, 0, true) { }
|
|
|
|
|
|
2007-11-11 19:44:10 +01:00
|
|
|
|
public ExampleAttribute(string title, ExampleCategory category, int difficulty)
|
2008-01-18 14:59:26 +01:00
|
|
|
|
: this(title, category, difficulty, true) { }
|
2007-11-11 19:44:10 +01:00
|
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
{
|
2008-01-18 14:59:26 +01:00
|
|
|
|
if (Difficulty != 0)
|
|
|
|
|
return String.Format("{0} {1}: {2}", Category, Difficulty, Title);
|
|
|
|
|
return String.Format("{0}: {1}", Category, Title);
|
2007-11-11 00:31:01 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum ExampleCategory
|
|
|
|
|
{
|
2008-01-18 14:59:26 +01:00
|
|
|
|
OpenGL = 0,
|
2007-11-11 00:31:01 +01:00
|
|
|
|
OpenAL,
|
2007-11-11 19:44:10 +01:00
|
|
|
|
Tutorial,
|
2007-11-11 00:31:01 +01:00
|
|
|
|
GLSL,
|
|
|
|
|
WinForms,
|
|
|
|
|
Test,
|
2008-01-18 14:59:26 +01:00
|
|
|
|
Last
|
2007-11-11 00:31:01 +01:00
|
|
|
|
}
|
|
|
|
|
}
|