Пример #1
0
        public object GetDescription(DesignItemProperty property)
        {
            IProjectContent pc = MyTypeFinder.GetProjectContent(file);

            if (pc != null)
            {
                // For attached Properties
                if (property.DependencyFullName != null && property.Name.Contains("."))
                {
                    IClass c = pc.GetClassByReflectionName(property.DependencyProperty.OwnerType.FullName, true);
                    if (c != null)
                    {
                        IMember m = DefaultProjectContent.GetMemberByReflectionName(c, property.DependencyProperty.Name + "Property");
                        if (m != null)
                        {
                            return(CodeCompletionItem.ConvertDocumentation(m.Documentation));
                        }
                    }
                }
                else
                {
                    IClass c = pc.GetClassByReflectionName(property.DeclaringType.FullName, true);
                    if (c != null)
                    {
                        IMember m = DefaultProjectContent.GetMemberByReflectionName(c, property.Name);
                        if (m != null)
                        {
                            return(CodeCompletionItem.ConvertDocumentation(m.Documentation));
                        }
                    }
                }
            }
            return(null);
        }
Пример #2
0
        void TestMember(string className, string memberName)
        {
            IClass c = mscorlib.GetClassByReflectionName(className, false);

            Assert.IsNotNull(c);
            AbstractMember m = (AbstractMember)DefaultProjectContent.GetMemberByReflectionName(c, memberName);

            Assert.AreEqual(className + "." + memberName, m.DocumentationTag.Substring(2));
        }
Пример #3
0
        internal static FilePosition GetPosition(IProjectContent pc, string className, string memberName)
        {
            IClass c = pc.GetClassByReflectionName(className, false);

            if (string.IsNullOrEmpty(memberName))
            {
                return(pc.GetPosition(c));
            }
            if (c != null)
            {
                IMember m = DefaultProjectContent.GetMemberByReflectionName(c, memberName);
                if (m != null)
                {
                    return(pc.GetPosition(m));
                }
            }
            return(FilePosition.Empty);
        }