예제 #1
0
        protected override bool CheckResolve(IReference reference, IElement element)
        {
            if (reference is TableReference && !DatabaseManager.GetInstance(element.GetManager().Solution).Enabled)
                return false;

            return base.CheckResolve(reference, element);
        }
        /// <summary>
        /// Gets the attribute.
        /// </summary>
        /// <param name="typeMemberDeclaration">
        /// The type member declaration.
        /// </param>
        /// <param name="attributeName">
        /// Name of the attribute.
        /// </param>
        /// <returns>
        /// </returns>
        private static ITypeElement GetAttribute(IElement typeMemberDeclaration, string attributeName)
        {
            var solution = typeMemberDeclaration.GetManager().Solution;

              var scope = DeclarationsScopeFactory.SolutionScope(solution, true);
              var cache = PsiManager.GetInstance(solution).GetDeclarationsCache(scope, true);

              var typeElement = cache.GetTypeElementByCLRName(attributeName);

              if (typeElement == null)
              {
            return null;
              }

              /*
              PredefinedType predefinedType = new PredefinedType(solution.SolutionProject);
              if(!TypeFactory.CreateType(typeElement).IsSubtypeOf(predefinedType.Attribute)) {
            return null;
              }
              */
              return typeElement;
        }