Esempio n. 1
0
        private static IProperty VerifyMemberIsDependencyProperty(XamlParserContext parserContext, ITextLocation lineInformation, IMember member)
        {
            IDependencyProperty dependencyProperty = member as IDependencyProperty;

            if (dependencyProperty != null)
            {
                return((IProperty)dependencyProperty);
            }
            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.MemberNotDependencyProperty(lineInformation, (IMemberId)member));
                }
            }
            return((IProperty)null);
        }