Advertisement
maxkhl

Untitled

Jun 27th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. <#@ template debug="false" hostspecific="false" language="C#" #>
  2. <#@ assembly name="System.Core" #>
  3. <#@ assembly name="$(TargetPath)" #>
  4. <#@ assembly name="$(TargetDir)LuaInterface.dll" #>
  5. <#@ import namespace="System.Linq" #>
  6. <#@ import namespace="System.Text" #>
  7. <#@ import namespace="System.Collections.Generic" #>
  8. <#@ import namespace="OutpostOmega.Game.Lua" #>
  9. <#@ output extension=".txt" #>
  10. <#
  11. var methods = typeof(Assembly).GetMethods(System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
  12. List<OutpostOmega.Game.Lua.LuaDocumentationAttr> Attributes = new List<OutpostOmega.Game.Lua.LuaDocumentationAttr>();
  13. foreach(var method in methods)
  14. {
  15. var attributes = method.GetCustomAttributes(typeof(LuaDocumentationAttr), false);
  16. if(attributes.Length == 1)
  17. {
  18. ((LuaDocumentationAttr)attributes[0]).MethodInfo = method;
  19. Attributes.Add((LuaDocumentationAttr)attributes[0]);
  20. }
  21. }
  22. Attributes = Attributes.OrderBy(o => o.Category).ToList();
  23. string OldCategory = "";
  24. string Output = "";
  25. foreach(var attribute in Attributes)
  26. {
  27. if(OldCategory != attribute.Category)
  28. {
  29.  
  30. Output += "####" + new String('#', attribute.Category.Length) + "####" + Environment.NewLine;
  31. Output += "### " + attribute.Category + " ###" + Environment.NewLine;
  32. Output += "####" + new String('#', attribute.Category.Length) + "####" + Environment.NewLine;
  33. }
  34. OldCategory = attribute.Category;
  35.  
  36. Output += attribute.MethodInfo.ToString() + Environment.NewLine;
  37. Output += "Description: " + attribute.Description + Environment.NewLine;
  38. Output += "Parameters: " + attribute.Parameters + Environment.NewLine;
  39. Output += "Returns: " + attribute.Return + Environment.NewLine;
  40. Output += Environment.NewLine;
  41. }
  42. #>
  43.  
  44. <#= Output #>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement