Ejemplo n.º 1
0
        protected override Declaration FindTargetDeclaration(QualifiedSelection targetSelection)
        {
            var candidates = _declarationFinderProvider.DeclarationFinder
                             .Members(targetSelection.QualifiedName)
                             .Where(item => ModuleTypes.Contains(item.DeclarationType));

            return(candidates.SingleOrDefault(item =>
                                              item.QualifiedSelection.QualifiedName.Equals(targetSelection.QualifiedName)));
        }
Ejemplo n.º 2
0
        protected override ExtractInterfaceModel InitializeModel(Declaration target)
        {
            if (target == null)
            {
                throw new TargetDeclarationIsNullException();
            }

            if (!ModuleTypes.Contains(target.DeclarationType))
            {
                throw new InvalidDeclarationTypeException(target);
            }

            return(new ExtractInterfaceModel(_declarationFinderProvider, target));
        }