/// <summary> /// Called when the user selects any of the plugin's menu options/commands /// </summary> /// <param name="command">The command id to execute</param> public void OnCommand(GoogleDesktopDisplayPluginCommand command) { if (command == GoogleDesktopDisplayPluginCommand.GDD_CMD_ABOUT_DLG) { // always throw this exception when you dont intend to override the default behavior // and you want the plugin helper to do it's usual stuff. throw new NotImplementedException(); } MessageBox.Show("Sidebar sent command " + command); }
/// <summary> /// Called when the user selects any of the plugin's menu options/commands /// </summary> /// <param name="command">The command id to execute</param> public void OnCommand(GoogleDesktopDisplayPluginCommand command) { if (command == GoogleDesktopDisplayPluginCommand.GDD_CMD_ABOUT_DLG) { // always throw this exception when you dont intend to override the default behavior // and you want the plugin helper to do it's usual stuff. throw new NotImplementedException(); } MessageBox.Show("Sidebar sent command " + command); }
/// <summary> /// Called when the user selects any of the plugin's menu options/commands /// </summary> /// <param name="command">The command id to execute</param> public new void OnCommand(GoogleDesktopDisplayPluginCommand command) { Log.Debug("DisplayPluginCommand executed with " + command); if (command == GoogleDesktopDisplayPluginCommand.GDD_CMD_ABOUT_DLG) { // always throw this exception when you dont intend to override the default behavior // and you want the plugin helper to do it's usual stuff. throw new NotImplementedException(); } RegistryKey key; key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Imagine Interactive\Gameserver Panel\Categories"); String[] categories = key.GetSubKeyNames(); int curIdx=0; for (int i=0; i<categories.Length; i++) { if (categories[i] == displayGroup) { curIdx = i; break; } } key.Close(); if (command == GoogleDesktopDisplayPluginCommand.GDD_CMD_TOOLBAR_FORWARD) { if (curIdx == (categories.Length-1) ) { curIdx = 0; } else { curIdx++; } } if (command == GoogleDesktopDisplayPluginCommand.GDD_CMD_TOOLBAR_BACK) { if (curIdx == 0 ) { curIdx = categories.Length-1; } else { curIdx--; } } refresh(categories[curIdx]); }