Пример #1
0
 public MethodExtraction(DeclarationRegistry registry, string name)
 {
     Name      = name;
     _model    = registry.Model;
     _registry = registry;
     _node     = _registry.GetMethod(name);
 }
Пример #2
0
 public TExtraction(DeclarationRegistry registry, string name)
 {
     Name      = name;
     _model    = registry.Model;
     _registry = registry;
     _node     = (TDeclarationSyntax)_registry.GetIType(name);
 }
Пример #3
0
        public static ITypeExtraction CreateTypeExtraction(DeclarationRegistry registry, string name)
        {
            TypeDeclarationSyntax node = registry.GetIType(name);

            switch (node)
            {
            case ClassDeclarationSyntax _: return(new ClassExtraction(registry, name));

            case StructDeclarationSyntax _: return(new StructExtraction(registry, name));

            case InterfaceDeclarationSyntax _: return(new InterfaceExtraction(registry, name));

            default: return(null);
            }
        }
        public static IEnumerable <ITypeExtraction> Reversed(DeclarationRegistry registry, string name, Func <ITypeExtraction, IEnumerable <ITypeExtraction> > getter)
        {
            IEnumerable <TypeDeclarationSyntax> declarations = registry.Types;

            foreach (TypeDeclarationSyntax declaration in declarations)
            {
                ITypeExtraction extraction = TypeExtraction.CreateTypeExtraction(registry, declaration.Identifier.ValueText);
                foreach (ITypeExtraction extr in getter(extraction))
                {
                    if (extr.Name == name)
                    {
                        yield return(extraction);
                    }
                }
            }
        }
 public StructExtraction(DeclarationRegistry registry, string name) : base(registry, name)
 {
 }
 public InterfaceExtraction(DeclarationRegistry registry, string name) : base(registry, name)
 {
 }
 public ClassExtraction(DeclarationRegistry registry, string name)  : base(registry, name)
 {
 }