PHP Code:
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace Mpdn.PlayerExtensions.Example
{
public class Test : IPlayerExtension
{
private IPlayerControl m_PlayerControl;
public ExtensionDescriptor Descriptor
{
get
{
return new ExtensionDescriptor
{
Guid = new Guid("7C3BA1E2-EE7B-47D2-B174-6AE76D65ED04"),
Name = "Test",
Description = "Player Extension Test",
Copyright = "Copyright Test © 2014. All rights reserved."
};
}
}
public void Initialize(IPlayerControl playerControl)
{
m_PlayerControl = playerControl;
m_PlayerControl.KeyDown += PlayerKeyDown;
}
public void Destroy()
{
m_PlayerControl.KeyDown -= PlayerKeyDown;
}
public IList<Verb> Verbs
{
get
{
return new[]
{
new Verb(Category.Help, string.Empty, "Test", "Ctrl+Shift+T", "test test test 1", Test1Click),
new Verb(Category.Help, "Test sub category", "Test", "Ctrl+Shift+R", "test test test 2", Test2Click)
};
}
}
private void Test1Click()
{
MessageBox.Show("Test1");
}
private void Test2Click()
{
MessageBox.Show("Test2");
}
private void PlayerKeyDown(object sender, PlayerKeyEventArgs e)
{
switch (e.Key.KeyData)
{
case Keys.Control | Keys.Shift | Keys.T:
Test1Click();
break;
case Keys.Control | Keys.Shift | Keys.R:
Test2Click();
break;
}
}
}
}