private IFieldDeclaration CreateFieldToHoldWrappedClass(IConstructLanguage language, ITypeName typeName, IClassDeclaration classDeclaration) { IFieldDeclaration fieldDeclaration = language.Field(language.Modifiers(Modifiers.Private | Modifiers.Readonly), typeName); NamingPolicy fieldsNamingPolicy = fieldDeclaration.PrimaryNamingPolicy(classDeclaration.FileModel.UserSettings); string fieldName = fieldsNamingPolicy.ChangeNameAccordingToPolicy(classDeclaration.Identifier.Name, classDeclaration.SolutionModel); fieldDeclaration.Identifier = language.Identifier(fieldName); return(fieldDeclaration); }
private IFieldDeclaration CreateFieldToHoldWrappedClass(IConstructLanguage language, ITypeName typeName, IClassDeclaration classDeclaration) { IFieldDeclaration fieldDeclaration = language.Field(language.Modifiers(Modifiers.Private | Modifiers.Readonly), typeName); NamingPolicy fieldsNamingPolicy = fieldDeclaration.PrimaryNamingPolicy(classDeclaration.FileModel.UserSettings); string fieldName = fieldsNamingPolicy.ChangeNameAccordingToPolicy(classDeclaration.Identifier.Name, classDeclaration.SolutionModel); fieldDeclaration.Identifier = language.Identifier(fieldName); return fieldDeclaration; }