Main.cs 864 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using Kbg.NppPluginNET.PluginInfrastructure;
  2. using System;
  3. using System.Windows.Forms;
  4. namespace HelloNppPlugin
  5. {
  6. public class Main
  7. {
  8. public const string PluginName = nameof(HelloNppPlugin);
  9. public static void CommandMenuInit()
  10. {
  11. PluginBase.SetCommand(0, "Say hello", SayHi);
  12. }
  13. private static void SayHi()
  14. {
  15. MessageBox.Show("Hello NppPlugin by C#!");
  16. }
  17. public static void SetToolBarIcon()
  18. {
  19. }
  20. public static void PluginCleanUp()
  21. {
  22. }
  23. public static void OnNotification(ScNotification notification)
  24. {
  25. }
  26. }
  27. internal class Win32Window : IWin32Window
  28. {
  29. public IntPtr Handle { get; }
  30. public Win32Window(IntPtr handle)
  31. {
  32. Handle = handle;
  33. }
  34. }
  35. }