示例#1
0
        /// <summary>
        /// Try to interpret the message as wmCommand
        /// </summary>
        /// <param name="msg">The message to check</param>
        /// <returns>The wmCommandResult or null if it is not a wmCommand message</returns>
        public static WmCommandResult CheckWmCommand(Message msg)
        {
            if (!WmCommandResult.IsCommandMessage(msg))
            {
                return(null);
            }

            return(new WmCommandResult(msg));
        }
示例#2
0
        internal void OnWndProc(ref Message msg)
        {
            LOG.Debug("Thumbnail Button: Do Action");

            WmCommandResult res = MessageInterpreter.CheckWmCommand(msg);

            if ((res != null) && (ID == res.ID))
            {
                switch (res.MouseAction)
                {
                case MouseAction.Clicked:
                    OnClick();
                    break;

                default:
                    throw new NotImplementedException();
                }
            }
        }