private NamesPicker Create(SolutionElements solutionElement)
        {
            NamesPicker namesPicker;

            switch (solutionElement)
            {
            case SolutionElements.IClass:
                namesPicker = new ClassNamesPicker();
                break;

            case SolutionElements.IMethod:
                namesPicker = new MethodNamesPicker();
                break;

            case SolutionElements.IProperty:
                namesPicker = new PropertyNamesPicker();
                break;

            case SolutionElements.IField:
                namesPicker = new FieldNamesPicker();
                break;

            case SolutionElements.IEnum:
                namesPicker = new EnumNamesPicker();
                break;

            case SolutionElements.IVariable:
                namesPicker = new VariableNamesPicker(FileHelper.GetCsFileBodies());
                break;

            default:
                throw new NotSupportedException();
            }

            return(namesPicker);
        }
Esempio n. 2
0
 public NamesPicker(SolutionElements solutionElement)
 {
     SolutionElement = solutionElement;
     classes         = Assembly.GetExecutingAssembly().GetTypes().Where(c => !c.CustomAttributes.Any(ca => ca.AttributeType.Name.Contains(nameof(CompilerGeneratedAttribute)))).ToArray();
 }
 public NamesPicker GetNamesPicker(SolutionElements solutionElement)
 {
     return(NamesPickers[solutionElement]);
 }