示例#1
0
        public override IEnumerable <TreeNodeData> CreateChildren()
        {
            if (!(analyzedProperty.GetMethod is null))
            {
                yield return(new PropertyAccessorNode(analyzedProperty.GetMethod, "get"));
            }

            if (!(analyzedProperty.SetMethod is null))
            {
                yield return(new PropertyAccessorNode(analyzedProperty.SetMethod, "set"));
            }

            foreach (var accessor in analyzedProperty.OtherMethods)
            {
                yield return(new PropertyAccessorNode(accessor, null));
            }

            if (PropertyOverriddenNode.CanShow(analyzedProperty))
            {
                yield return(new PropertyOverriddenNode(analyzedProperty));
            }

            if (PropertyOverridesNode.CanShow(analyzedProperty))
            {
                yield return(new PropertyOverridesNode(analyzedProperty));
            }

            if (InterfacePropertyImplementedByNode.CanShow(analyzedProperty))
            {
                yield return(new InterfacePropertyImplementedByNode(analyzedProperty));
            }
        }
示例#2
0
        public override IEnumerable <TreeNodeData> CreateChildren()
        {
            if (analyzedProperty.GetMethod != null)
            {
                yield return(new PropertyAccessorNode(analyzedProperty.GetMethod, dnSpy_Analyzer_Resources.PropertyGetterTreeNode));
            }
            if (analyzedProperty.SetMethod != null)
            {
                yield return(new PropertyAccessorNode(analyzedProperty.SetMethod, dnSpy_Analyzer_Resources.PropertySetterTreeNode));
            }
            foreach (var accessor in analyzedProperty.OtherMethods)
            {
                yield return(new PropertyAccessorNode(accessor, null));
            }

            if (PropertyOverriddenNode.CanShow(analyzedProperty))
            {
                yield return(new PropertyOverriddenNode(analyzedProperty));
            }
            if (PropertyOverridesNode.CanShow(analyzedProperty))
            {
                yield return(new PropertyOverridesNode(analyzedProperty));
            }
            if (InterfacePropertyImplementedByNode.CanShow(analyzedProperty))
            {
                yield return(new InterfacePropertyImplementedByNode(analyzedProperty));
            }
        }
示例#3
0
        public static bool CanShow(IMemberRef member, ILanguage language)
        {
            var property = member as PropertyDef;

            if (property == null)
            {
                return(false);
            }

            return(!language.ShowMember(property.GetMethod ?? property.SetMethod) ||
                   PropertyOverridesNode.CanShow(property));
        }