using System; using System.Collections.Generic; using System.Reflection; using System.IO; using ANX.Framework.NonXNA.Development; namespace OnlineStatusGenerator { class Program { static void Main(string[] args) { var assembly = Assembly.LoadFile(Path.GetFullPath("ANX.Framework.dll")); Type[] allTypes = assembly.GetTypes(); var namespaces = new Dictionary>(); foreach (Type type in allTypes) { if (type.Namespace.Contains("NonXNA") || type.IsPublic == false) continue; if (namespaces.ContainsKey(type.Namespace) == false) namespaces.Add(type.Namespace, new List()); namespaces[type.Namespace].Add(type); } var sortedKeys = new List(namespaces.Keys); sortedKeys.Sort(); string result = ""; foreach (string space in sortedKeys) { result += "\n"; foreach (Type type in namespaces[space]) { result += "\n"; object[] percentageAttributes = type.GetCustomAttributes(typeof(PercentageCompleteAttribute), false); var percentageAttribute = percentageAttributes.Length > 0 ? percentageAttributes[0] as PercentageCompleteAttribute : null; result += ""; object[] developerAttributes = type.GetCustomAttributes(typeof(DeveloperAttribute), false); var developerAttribute = developerAttributes.Length > 0 ? developerAttributes[0] as DeveloperAttribute : null; result += ""; object[] testAttributes = type.GetCustomAttributes(typeof(TestStateAttribute), false); var testAttribute = testAttributes.Length > 0 ? testAttributes[0] as TestStateAttribute : null; result += ""; result += ""; } } result += "
" + space + "%DeveloperTest State
" + type.Name + "" + (percentageAttribute != null ? percentageAttribute.Percentage.ToString() : "---") + "" + (developerAttribute != null ? developerAttribute.Developer : "---") + "" + (testAttribute != null ? testAttribute.State.ToString() : "---") + "
"; File.WriteAllText("Report.html", result); System.Diagnostics.Process.Start("Report.html"); } } }