internal static PushpinContextCommand ShowPushpinContextMenu(Control parent, Point location, CommandManager commandManager) { Command command; using (CommandLoader commandLoader = new CommandLoader(commandManager, PushpinContextMenuIds)) { CommandContextMenuDefinition ccmd = new CommandContextMenuDefinition(); ccmd.CommandBar = false; ccmd.Entries.Add(CommandId.MapEditPushpin, false, false); ccmd.Entries.Add(CommandId.MapDeletePushpin, false, false); command = CommandContextMenu.ShowModal( commandManager, parent, location, ccmd); } if (command != null) return (PushpinContextCommand)_pushpinCommandIds[Enum.Parse(typeof(CommandId), command.Identifier)]; else return PushpinContextCommand.None; }
internal static MapContextCommand ShowMapContextMenu(Control parent, Point location, MapContextCommand[] hideCommands, CommandManager commandManager) { Command returnCommand; using (CommandLoader commandLoader = new CommandLoader(commandManager, FilterMapContextMenuCommands(hideCommands))) { CommandContextMenuDefinition ccmd = new CommandContextMenuDefinition(); ccmd.CommandBar = false; ccmd.Entries.Add(CommandId.MapAddPushpin, false, true); ccmd.Entries.Add(CommandId.MapZoomStreetLevel, false, false); ccmd.Entries.Add(CommandId.MapZoomCityLevel, false, false); ccmd.Entries.Add(CommandId.MapZoomRegionLevel, false, false); ccmd.Entries.Add(CommandId.MapCenterMap, false, false); returnCommand = CommandContextMenu.ShowModal( commandManager, parent, location, ccmd); } if (returnCommand != null) return (MapContextCommand)_mapCommandIds[Enum.Parse(typeof(CommandId), returnCommand.Identifier)]; else return MapContextCommand.None; }