|
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace NotepadHandlerNET
{
#region Register Command
/// <summary>
/// Class implementing Register command.
/// </summary>
public class register : ICommandImpl
{
public object DoCommand(string sender, object commandData)
{
new AddNotificationSubscriber(sender).Do();
return "OK";
}
}
#endregion
#region CopyText Command
/// <summary>
/// Class implementing CopyText command.
/// </summary>
public class copytext : ICommandImpl
{
public object DoCommand(string sender, object commandData)
{
new NotifyAll("CopyText", Handler.sb.ToString()).Do();
Handler.sb.Remove(0, Handler.sb.Length);
return "OK";
}
}
#endregion
#region FindDialog Command
/// <summary>
/// Class implementing FindDialog command.
/// </summary>
public class finddialog : ICommandImpl
{
[DllImport("NotepadPlugin.dll")]
static extern int ActivateFindDialog();
public object DoCommand(string sender, object commandData)
{
return (0 == ActivateFindDialog()) ? "OK" : "FAILURE";
}
}
#endregion
#region AppendMenu Command
/// <summary>
/// Class implementing AppendMenu command.
/// </summary>
public class appendmenu : ICommandImpl
{
[DllImport("NotepadPlugin.dll")]
static extern int AppendMainMenu([MarshalAs(UnmanagedType.BStr)] string menuName);
public object DoCommand(string sender, object commandData)
{
return (0 == AppendMainMenu((string)commandData)) ? "OK" : "FAILURE";
}
}
#endregion
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.