Catel.ReSharper.CatelProperties.CSharp.Actions.HideModelPropertyContextAction.IsAvailable C# (CSharp) Method

IsAvailable() protected method

protected IsAvailable ( ) : bool
return bool
        protected override bool IsAvailable()
        {
            ITypeElement typeElement;
            IAttribute viewModelToModelAttribute = null;
            if (CatelMVVM.TryGetViewModelToModelAttributeTypeElement(Provider.PsiModule, Provider.SelectedElement.GetResolveContext(), out typeElement))
            {
                viewModelToModelAttribute = (from attribute in PropertyDeclaration.Attributes
                                             where
                                                 attribute.TypeReference != null
                                                 && attribute.TypeReference.CurrentResolveResult != null
                                                 && typeElement.Equals(
                                                     attribute.TypeReference.CurrentResolveResult.DeclaredElement)
                                             select attribute).FirstOrDefault();
            }

            return viewModelToModelAttribute != null && PropertyDeclaration.HasDefaultCatelImplementation();
        }