コード例 #1
0
        /// <summary>
        /// Gets the ControllerDescriptor that matches this Address.
        /// </summary>
        public static LetterHandlerDescriptor GetTargetLetterHandlerDescriptor(this Address Address)
        {
            var actions = GetTargetActionDescriptors(Address);
            LetterHandlerDescriptor letterHandler = null;

            foreach (var action in actions)
            {
                if (letterHandler == null)
                {
                    letterHandler = action.LetterHandlerDescriptor;
                }
                else if (letterHandler != action.LetterHandlerDescriptor)
                {
                    // Don't provide a single controller descriptor if multiple controllers match.
                    return(null);
                }
            }

            return(letterHandler);
        }
コード例 #2
0
        public static Type GetTargetLetterHandlerType(this AddressData AddressData)
        {
            LetterHandlerDescriptor letterHandlerDescriptor = AddressData.GetTargetLetterHandlerDescriptor();

            return(letterHandlerDescriptor == null ? null : letterHandlerDescriptor.LetterHandlerType);
        }