PageRenderTime 56ms CodeModel.GetById 11ms RepoModel.GetById 1ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/App_Code/Extensions/CodeFormatter/CSharpFormat.cs

#
C# | 63 lines | 31 code | 4 blank | 28 comment | 0 complexity | 3586925dde7e9780347ef31f87f3d7d1 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  1. #region Copyright © 2001-2003 Jean-Claude Manoli [jc@manoli.net]
  2. /*
  3. * This software is provided 'as-is', without any express or implied warranty.
  4. * In no event will the author(s) be held liable for any damages arising from
  5. * the use of this software.
  6. *
  7. * Permission is granted to anyone to use this software for any purpose,
  8. * including commercial applications, and to alter it and redistribute it
  9. * freely, subject to the following restrictions:
  10. *
  11. * 1. The origin of this software must not be misrepresented; you must not
  12. * claim that you wrote the original software. If you use this software
  13. * in a product, an acknowledgment in the product documentation would be
  14. * appreciated but is not required.
  15. *
  16. * 2. Altered source versions must be plainly marked as such, and must not
  17. * be misrepresented as being the original software.
  18. *
  19. * 3. This notice may not be removed or altered from any source distribution.
  20. */
  21. #endregion
  22. namespace CodeFormatter
  23. {
  24. /// <summary>
  25. /// Generates color-coded HTML 4.01 from C# source code.
  26. /// </summary>
  27. public class CSharpFormat : CLikeFormat
  28. {
  29. #region Properties
  30. /// <summary>
  31. /// The list of C# keywords.
  32. /// </summary>
  33. protected override string Keywords
  34. {
  35. get
  36. {
  37. return "abstract as base bool break byte case catch char " +
  38. "checked class const continue decimal default delegate do double else " +
  39. "enum event explicit extern false finally fixed float for foreach goto " +
  40. "if implicit in int interface internal is lock long namespace new null " +
  41. "object operator out override partial params private protected public readonly " +
  42. "ref return sbyte sealed short sizeof stackalloc static string struct " +
  43. "switch this throw true try typeof uint ulong unchecked unsafe ushort " +
  44. "using value virtual void volatile where while yield";
  45. }
  46. }
  47. /// <summary>
  48. /// The list of C# preprocessors.
  49. /// </summary>
  50. protected override string Preprocessors
  51. {
  52. get
  53. {
  54. return "#if #else #elif #endif #define #undef #warning #error #line #region #endregion #pragma";
  55. }
  56. }
  57. #endregion
  58. }
  59. }