Example #1
0
 /// <summary>
 /// Called to handle a command that takes a collection of selected objects and a completion action
 /// </summary>
 /// <param name="commandIdentity"></param>
 /// <param name="selection"></param>
 /// <param name="callback"></param>
 public virtual void HandleCommand(int commandIdentity, GroupedSelection selection, CommandRouter.CommandHandlerCallback callback, AppCompatImageButton button)
 {
     selectedObjects = selection;
     commandCallback = callback;
     commandButton   = button;
     HandleCommand(commandIdentity);
 }
Example #2
0
        /// <summary>
        /// Called by the user interface to handle a command requiring a collection of selected objects
        /// </summary>
        /// <param name="commandIdentity"></param>
        /// <returns></returns>
        public static bool HandleCommand(int commandIdentity, IEnumerable <object> selectedObjects, CommandRouter.CommandHandlerCallback callback,
                                         AppCompatImageButton button)
        {
            bool commandHandled = false;

            CommandHandler handler = router.GetValueOrDefault(commandIdentity);

            if (handler != null)
            {
                commandHandled = true;
                handler.HandleCommand(commandIdentity, new GroupedSelection(selectedObjects), callback, button);
            }

            return(commandHandled);
        }