using System; using System.Collections.Generic; using System.Text; namespace menuitem { public class menuitem : iMenuItem { #region iMenuItem Members // executed when application starts void iMenuItem.Start() { } // executed when application exits void iMenuItem.Stop() { } // executed when the watch connects void iMenuItem.Connect() { } // executed when the watch disconnects void iMenuItem.Disconnect() { } // executed when a button is pressed (your menu item must be selected as active) string iMenuItem.keyPress(string button) { //m_alertEvent.Invoke(pluginUtils.alertType.Envelope, ""); //m_alertEvent.Invoke(pluginUtils.alertType.Vibrate, ""); //m_alertEvent.Invoke(pluginUtils.alertType.Text2LinesNoScroll, "test\r\ntest"); //m_alertEvent.Invoke(pluginUtils.alertType.Text2LinesScroll, "test\r\ntest"); //m_alertEvent.Invoke(pluginUtils.alertType.TextFull, "test\r\ntest"); // print a line to smartWatchM log window //m_alertEvent.Invoke(pluginUtils.alertType.Logln, "test"); switch (button) { case "STOP": return "STOP\r\nbutton pressed"; case "PLAY": return "PLAY\r\nbutton pressed"; case "FF": return "FF\r\nbutton pressed"; case "RW": return "RW\r\nbutton pressed"; default: return ""; } } private event pluginUtils.pluginEvent m_alertEvent; event pluginUtils.pluginEvent iMenuItem.alertEvent { add { m_alertEvent += new pluginUtils.pluginEvent(value); } remove { m_alertEvent -= new pluginUtils.pluginEvent(value); } } #endregion } }