Пример #1
0
        private static IEvent VerifyMemberIsRoutedEvent(XamlParserContext parserContext, ITextLocation lineInformation, IMember member)
        {
            IEvent @event = member as IEvent;

            if (@event != null && @event.IncludesRoutedEvent)
            {
                return(@event);
            }
            if (member.IsResolvable)
            {
                IType     declaringType           = member.DeclaringType;
                Exception initializationException = declaringType.InitializationException;
                if (initializationException != null)
                {
                    parserContext.ReportError(XamlParseErrors.TypeInitializationException(lineInformation, (ITypeId)declaringType, initializationException.Message));
                }
                else
                {
                    parserContext.ReportError(XamlParseErrors.MemberNotRoutedEvent(lineInformation, (IMemberId)member));
                }
            }
            return((IEvent)null);
        }