UnmanagedExportsStubsToBridge.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Diagnostics.CodeAnalysis;
  3. using System.Runtime.InteropServices;
  4. using NppChnConvPlugin.NppPluginInfrastructure;
  5. // ReSharper disable UnusedMember.Global
  6. // ReSharper disable InconsistentNaming
  7. namespace NppChnConvPlugin
  8. {
  9. [SuppressMessage("ReSharper", "UnusedMember.Local")]
  10. internal class UnmanagedExportsStubs
  11. {
  12. static UnmanagedExportsStubs()
  13. {
  14. AssemblyResolveInMyAround.Register();
  15. }
  16. [DllExport(CallingConvention = CallingConvention.Cdecl)]
  17. private static bool isUnicode()
  18. {
  19. return ManagedExportsBridge.IsUnicode();
  20. }
  21. [DllExport(CallingConvention = CallingConvention.Cdecl)]
  22. private static IntPtr getName()
  23. {
  24. return ManagedExportsBridge.GetName();
  25. }
  26. [DllExport(CallingConvention = CallingConvention.Cdecl)]
  27. private static void setInfo(NppData notepadPlusData)
  28. {
  29. ManagedExportsBridge.SetInfo(notepadPlusData);
  30. }
  31. [DllExport(CallingConvention = CallingConvention.Cdecl)]
  32. private static IntPtr getFuncsArray(ref int nbF)
  33. {
  34. return ManagedExportsBridge.GetFuncsArray(ref nbF);
  35. }
  36. [DllExport(CallingConvention = CallingConvention.Cdecl)]
  37. private static uint messageProc(uint Message, IntPtr wParam, IntPtr lParam)
  38. {
  39. return ManagedExportsBridge.MessageProc(Message, wParam, lParam);
  40. }
  41. [DllExport(CallingConvention = CallingConvention.Cdecl)]
  42. private static void beNotified(IntPtr notifyCode)
  43. {
  44. ManagedExportsBridge.BeNotified(notifyCode);
  45. }
  46. }
  47. }