コード例 #1
0
        public sealed override bool IsAvailable(JetBrains.Util.IUserDataHolder cache)
        {
            attributesOwnerDeclaration = provider.GetSelectedElement<IAttributesOwnerDeclaration>(true, false);

            if (attributesOwnerDeclaration != null && attributesOwnerDeclaration.GetNameRange().Contains(provider.SelectedTreeRange) &&
                !attributesOwnerDeclaration.OverridesInheritedMember() && !attributesOwnerDeclaration.AttributesEnumerable.Any(IsAttribute))
            {
                createAttributeFactory = CreateAttributeFactoryIfAvailable(attributesOwnerDeclaration, provider.PsiModule, out attributeToRemove);

                if (createAttributeFactory != null)
                {
                    return true;
                }
            }

            attributeToRemove = null;
            createAttributeFactory = null;
            attributesOwnerDeclaration = null;

            return false;
        }