CodeEditor.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using BansheeEngine;
  4. namespace BansheeEditor
  5. {
  6. // Note: Must match C++ CodeEditorType enum
  7. public enum CodeEditorType
  8. {
  9. VS2008,
  10. VS2010,
  11. VS2012,
  12. VS2013,
  13. VS2015
  14. }
  15. public static class CodeEditor
  16. {
  17. public static CodeEditorType ActiveEditor
  18. {
  19. set { Internal_SetActiveEditor(value); }
  20. }
  21. public static CodeEditorType[] AvailableEditors
  22. {
  23. get { return Internal_GetAvailableEditors(); }
  24. }
  25. public static void OpenFile(string path, UInt32 line)
  26. {
  27. Internal_OpenFile(path, line);
  28. }
  29. public static void SyncSolution()
  30. {
  31. Internal_SyncSolution();
  32. }
  33. [MethodImpl(MethodImplOptions.InternalCall)]
  34. internal static extern void Internal_SetActiveEditor(CodeEditorType type);
  35. [MethodImpl(MethodImplOptions.InternalCall)]
  36. internal static extern CodeEditorType[] Internal_GetAvailableEditors();
  37. [MethodImpl(MethodImplOptions.InternalCall)]
  38. internal static extern void Internal_OpenFile(string path, UInt32 line);
  39. [MethodImpl(MethodImplOptions.InternalCall)]
  40. internal static extern void Internal_SyncSolution();
  41. }
  42. }