コード例 #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);
            }
        }
コード例 #2
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);
        }
コード例 #3
0
ファイル: SystemHook.cs プロジェクト: Season02/MK2.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);
		}