Beispiel #1
0
        /// <include file='ManagedHooks.xml' path='Docs/SystemHook/FilterMessage/*'/>
        protected void FilterMessage(HookTypes hookType, int message)
        {
            FilterMessageResults result = InternalFilterMessage(hookType, message);

            if (result != FilterMessageResults.Success)
            {
                GenerateFilterMessageException(hookType, result);
            }
        }
        private void GenerateFilterMessageException(HookTypes type, FilterMessageResults result)
        {
            if (result == FilterMessageResults.Success)
            {
                return;
            }

            string msg;

            if (result == FilterMessageResults.NotImplemented)
            {
                msg  = "The hook type of type " + type + " is not implemented in the C++ layer. ";
                msg += "You must implement this hook type before you can use it. See the C++ function ";
                msg += "FilterMessage.";

                throw new HookTypeNotImplementedException(msg);
            }

            //
            // All other errors are general errors.
            //
            msg = "Unrecognized exception during hook FilterMessage call. Error code " + result + ".";
            throw new ManagedHooksException(msg);
        }
Beispiel #3
0
		private void GenerateFilterMessageException(HookTypes type, FilterMessageResults result)
		{
			if (result == FilterMessageResults.Success)
			{
				return;
			}

			string msg;

			if (result == FilterMessageResults.NotImplemented)
			{
					msg = "The hook type of type " + type + " is not implemented in the C++ layer. ";
					msg += "You must implement this hook type before you can use it. See the C++ function ";
					msg += "FilterMessage.";

					throw new HookTypeNotImplementedException(msg);
			}

			//
			// All other errors are general errors.
			//
			msg = "Unrecognized exception during hook FilterMessage call. Error code " + result + ".";
			throw new ManagedHooksException(msg);
		}