From bf269b2d0d01a6b4383be46539820f64669aee92 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Thu, 17 Jan 2008 14:06:14 +0000 Subject: [PATCH] Show hidden examples in debug mode. --- Source/Examples/ExampleAttribute.cs | 3 ++- Source/Examples/ExampleLauncher.cs | 26 ++++++++++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Source/Examples/ExampleAttribute.cs b/Source/Examples/ExampleAttribute.cs index 4ca30b55..e43de3fe 100644 --- a/Source/Examples/ExampleAttribute.cs +++ b/Source/Examples/ExampleAttribute.cs @@ -13,7 +13,8 @@ namespace Examples [AttributeUsage(AttributeTargets.Class)] public class ExampleAttribute : System.Attribute { - public readonly string Title; + string title; + public string Title { get { return title; } internal set { title = value; } } public readonly ExampleCategory Category; public readonly int Difficulty; public readonly bool Visible = true; diff --git a/Source/Examples/ExampleLauncher.cs b/Source/Examples/ExampleLauncher.cs index 89e76560..ce4ad60d 100644 --- a/Source/Examples/ExampleLauncher.cs +++ b/Source/Examples/ExampleLauncher.cs @@ -97,21 +97,27 @@ namespace Examples if (example != null) { - sb.Append(example.Category); - sb.Append(" "); - if (example.Difficulty < 10) - sb.Append("0"); // To keep items nicely sorted. - sb.Append(example.Difficulty); - sb.Append(": "); - //sb.Append(type.Name); - sb.Append(example.Title); + //sb.Append(example.Category); + //sb.Append(" "); + //if (example.Difficulty < 10) + // sb.Append("0"); // To keep items nicely sorted. + //sb.Append(example.Difficulty); + //sb.Append(": "); + ////sb.Append(type.Name); + //sb.Append(example.Title); if (example.Visible && example.Category != ExampleCategory.Test) listBox1.Items.Add(new ExampleInfo(type, example)); else + { +#if DEBUG + example.Title += " (hidden)"; + listBox1.Items.Add(new ExampleInfo(type, example)); +#else hidden_items.Add(new ExampleInfo(type, example)); - - // Clean the StringBuilder for the next pass. +#endif + } + // Clean the StringBuilder for the next pass. sb.Remove(0, sb.Length); } }