2
0

IDebugCommandHost.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // IDebugCommandHost.cs
  4. //
  5. // Microsoft XNA Community Game Platform
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. #region Using Statements
  10. using System.Collections.Generic;
  11. #endregion
  12. namespace PerformanceMeasuring.GameDebugTools
  13. {
  14. /// <summary>
  15. /// Message types for debug command.
  16. /// </summary>
  17. public enum DebugCommandMessage
  18. {
  19. Standard = 1,
  20. Error = 2,
  21. Warning = 3
  22. }
  23. /// <summary>
  24. /// Debug command execution delegate.
  25. /// </summary>
  26. /// <param name="host">Host who will execute the command.</param>
  27. /// <param name="command">command name</param>
  28. /// <param name="arguments">command arguments</param>
  29. public delegate void DebugCommandExecute(IDebugCommandHost host, string command,
  30. IList<string> arguments);
  31. /// <summary>
  32. /// Interface for debug command executioner.
  33. /// </summary>
  34. public interface IDebugCommandExecutioner
  35. {
  36. /// <summary>
  37. /// Execute command
  38. /// </summary>
  39. void ExecuteCommand(string command);
  40. }
  41. /// <summary>
  42. /// Interface for debug command message listener.
  43. /// </summary>
  44. public interface IDebugEchoListner
  45. {
  46. /// <summary>
  47. /// Output message.
  48. /// </summary>
  49. /// <param name="messageType">type of message</param>
  50. /// <param name="text">message text</param>
  51. void Echo(DebugCommandMessage messageType, string text);
  52. }
  53. /// <summary>
  54. /// Interface for debug command host.
  55. /// </summary>
  56. public interface IDebugCommandHost : IDebugEchoListner, IDebugCommandExecutioner
  57. {
  58. /// <summary>
  59. /// Register new command.
  60. /// </summary>
  61. /// <param name="command">command name</param>
  62. /// <param name="description">description of command</param>
  63. /// <param name="callback">Execute delegation</param>
  64. void RegisterCommand(string command, string description,
  65. DebugCommandExecute callback);
  66. /// <summary>
  67. /// Unregister command.
  68. /// </summary>
  69. /// <param name="command">command name</param>
  70. void UnregisterCommand(string command);
  71. /// <summary>
  72. /// Output Standard message.
  73. /// </summary>
  74. /// <param name="text"></param>
  75. void Echo(string text);
  76. /// <summary>
  77. /// Output Warning message.
  78. /// </summary>
  79. /// <param name="text"></param>
  80. void EchoWarning(string text);
  81. /// <summary>
  82. /// Output Error message.
  83. /// </summary>
  84. /// <param name="text"></param>
  85. void EchoError(string text);
  86. /// <summary>
  87. /// Register message listener.
  88. /// </summary>
  89. /// <param name="listner"></param>
  90. void RegisterEchoListner(IDebugEchoListner listner);
  91. /// <summary>
  92. /// Unregister message listener.
  93. /// </summary>
  94. /// <param name="listner"></param>
  95. void UnregisterEchoListner(IDebugEchoListner listner);
  96. /// <summary>
  97. /// Add Command executioner.
  98. /// </summary>
  99. void PushExecutioner(IDebugCommandExecutioner executioner);
  100. /// <summary>
  101. /// Remote Command executioner.
  102. /// </summary>
  103. void PopExecutioner();
  104. }
  105. }