Nextended.CodeGen — API-Referenz
Die vollständige öffentliche Oberfläche von Nextended.CodeGen, erzeugt aus der gebauten Assembly.
Generiert
Diese Seite wird von tools/ApiRef aus der kompilierten Assembly erzeugt — sie zeigt auch Member ohne XML-Kommentar und kann daher nicht vom Code abweichen. Nicht von Hand bearbeiten.
Nextended.CodeGen
GenerationContext
class
Keine Beschreibung.
Konstruktoren
GenerationContext(AdditionalText additionalFile, GeneratorExecutionContext executionContext, MainConfig config)GenerationContext(AdditionalText additionalFile, SourceProductionContext productionContext, Compilation compilation, AnalyzerConfigOptionsProvider optionsProvider, MainConfig config)GenerationContext(NamespaceResolver namespaceResolver, GeneratorExecutionContext executionContext, MainConfig config)GenerationContext(NamespaceResolver namespaceResolver, SourceProductionContext productionContext, Compilation compilation, AnalyzerConfigOptionsProvider optionsProvider, MainConfig config)
Methoden
AddSource(string hintName, string content) : voidReportDiagnostic(Diagnostic diagnostic) : void
Eigenschaften
AdditionalFile : AdditionalText { get; }Compilation : Compilation { get; }Config : MainConfig { get; }ExecutionContext : GeneratorExecutionContext? { get; }NamespaceResolver : NamespaceResolver { get; }OptionsProvider : AnalyzerConfigOptionsProvider { get; }ProductionContext : SourceProductionContext? { get; }
MainGenerator
class
Keine Beschreibung.
Konstruktoren
MainGenerator()
Methoden
Initialize(IncrementalGeneratorInitializationContext context) : void
Felder
BuildId : Guid
Nextended.CodeGen.Config
ClassStructureCodeGenerationConfig
class
Keine Beschreibung.
Konstruktoren
ClassStructureCodeGenerationConfig()
Eigenschaften
ArrayGeneration : JsonArrayGeneration { get; set; }Ignore : string[] { get; set; }RootClassName : string { get; set; }SourceFile : string { get; set; }
CodeGenerationConfigBase
class
Keine Beschreibung.
Konstruktoren
CodeGenerationConfigBase()
Eigenschaften
CreateFileHeaders : bool { get; set; }
Set t true to generate file headers for the generated code files.DisableGeneration : bool { get; set; }
If set to true, the generation will be disabled.ModelType : GeneratedModelType { get; set; }
Type of the generated model. Can be one of the following: Class, Record, RecordStruct, Struct.Namespace : string { get; set; }
Default namespace for generated classes. Can be overwritten for DTOs in the AutoGenerateDtoAttribute. If null same as source will be used. (can be overwritten per class in Attribute layer)OutputPath : string { get; set; }
The path where the generated file will be saved. By default it's null and will be added to the generated code context. If a path is set, the file will be saved to that path and NOT added to the generated code context.Prefix : string { get; set; }
Default prefix for generated DTOs will only work when not set on Attribute layer. (can be overwritten per class in Attribute layer)Suffix : string { get; set; }
Default suffix for generated DTOs will only work when not set on Attribute layer.
CodeToDocsConfig
class
Keine Beschreibung.
Konstruktoren
CodeToDocsConfig()
Eigenschaften
DisableGeneration : bool { get; set; }FileIncludePattern : string { get; set; }InputFolder : string { get; set; }OutputPath : string { get; set; }SourceExportTypes : SourceExportType[] { get; set; }
DefaultMappingSettings
class
Keine Beschreibung.
Konstruktoren
DefaultMappingSettings()
Eigenschaften
MapWithClassMapper : bool? { get; set; }ToDtoMethodName : string { get; set; }ToSourceMethodName : string { get; set; }
DtoGenerationConfig
class
Keine Beschreibung.
Konstruktoren
DtoGenerationConfig()
Eigenschaften
AddContainingNamespaceUsings : bool? { get; set; }
Gets or sets a value indicating whether to includeusingdirectives for namespacesAddReferencedNamespacesUsings : bool? { get; set; }
Gets or sets a value indicating whether to includeusingdirectives for namespaces referenced by the properties of the generated DTOs.AlwaysGenerateFactoryOverloads : bool { get; set; }BaseType : string { get; set; }
Default Sets the base type for all the generated DTO class when not overriden.ComIdClassModifier : Modifier { get; set; }
Modifier for the generated COM id class.ComIdClassName : string { get; set; }
If Compatible is set to true then the generated classes are COM visible and fully com compatible. This setting represents the CLassName for the generated com id class that contains all required idsComIdClassPropertyFormat : string { get; set; }
Format string for the name of the Id property inside the generated com id class.CreateComments : bool { get; set; }CreateRegions : bool { get; set; }DeepProperties : bool { get; set; }
When set to true, properties of non generated base classes will also be included in the generated DTO.DefaultMappingSettings : DefaultMappingSettings { get; set; }
Default mapping generation settings.GenerateFactoryOverloadsForAbstract : bool { get; set; }GeneratePartial : bool { get; set; }GenerateToMethodsForAbstract : bool { get; set; }Interfaces : string[] { get; set; }
Adds interfaces to all generated DTO class and generated interface where setting is not overwritten.KeepAttributesOnGeneratedClass : bool { get; set; }
If set to true, the generated classes will keep the attributes from the original class.KeepAttributesOnGeneratedInterface : bool { get; set; }
If set to true, the generated interfaces will keep the attributes from the original class.MakeDtoAbstractWhenSourceIsAbstract : bool { get; set; }MappingOutputPath : string { get; set; }OneFilePerClass : bool { get; set; }PreClassString : string { get; set; }
A string that will be added before the generated class, useful for adding attributes or something.PreInterfaceString : string { get; set; }
A string that will be added before the generated interface, useful for adding attributes or something.Usings : string[] { get; set; }
ExcelGenerationConfig
class
Keine Beschreibung.
Konstruktoren
ExcelGenerationConfig()
Eigenschaften
ColumnMappings : IDictionary<string, string> { get; set; }DataStartRowIndex : int { get; set; }GenerateAllCollection : bool { get; set; }GenerateModelClass : bool { get; set; }GenerateStaticTable : bool { get; set; }HeaderRowIndex : int { get; set; }KeyColumn : string { get; set; }ModelClassPrefix : string { get; set; }OutputPath : string { get; set; }PropertyTypeOverrides : IDictionary<string, string> { get; set; }RootClassName : string { get; set; }SheetName : string { get; set; }SourceFile : string { get; set; }StaticClassName : string { get; set; }StaticPropertyPrefix : string { get; set; }
MainConfig
class
Keine Beschreibung.
Konstruktoren
MainConfig()
Eigenschaften
CodeToDocs : List<CodeToDocsConfig> { get; set; }DtoGeneration : DtoGenerationConfig { get; set; }ExcelGenerations : List<ExcelGenerationConfig> { get; set; }StructureGenerations : List<ClassStructureCodeGenerationConfig> { get; set; }
SourceExportType
enum
Keine Beschreibung.
Werte
HtmlMarkdownPlainTextvalue__
Nextended.CodeGen.Contracts
GeneratedFile
class
Keine Beschreibung.
Konstruktoren
GeneratedFile(string fileName, string ns, string content, CodeGenerationConfigBase config)GeneratedFile(string fileName, string ns, string content, string outputPath = null)
Eigenschaften
Content : string { get; }FileName : string { get; }Namespace : string { get; }OutputPath : string { get; set; }
The path where the generated file will be saved. By default it's null and will be added to the generated code context. If a path is set, the file will be saved to that path and NOT added to the generated code context.
ISourceSubGenerator
interface
Keine Beschreibung.
Methoden
Execute(GenerationContext context) : IEnumerable<GeneratedFile>
Eigenschaften
RequireConfig : bool { get; }
Nextended.CodeGen.Generators.CodeToText
CodeToTextGenerator
class
Keine Beschreibung.
Konstruktoren
CodeToTextGenerator()
Methoden
Execute(GenerationContext context) : IEnumerable<GeneratedFile>
Eigenschaften
RequireConfig : bool { get; }
Nextended.CodeGen.Generators.DtoGeneration
DtoCodeGenerator
class
Keine Beschreibung.
Konstruktoren
DtoCodeGenerator(DtoGenerationConfig config, DtoGenerationSymbols symbols)
Methoden
GenerateAllForType(INamedTypeSymbol type, List<INamedTypeSymbol> allTypes) : GeneratedFileGenerateClass(INamedTypeSymbol type, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool addGeneric) : stringGenerateComIdFile(IEnumerable<INamedTypeSymbol> allTypes) : GeneratedFileGenerateEnum(INamedTypeSymbol enumType, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : stringGenerateGuids() : stringGenerateInterface(INamedTypeSymbol type, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool addGeneric) : stringGenerateMappingExtensions(List<INamedTypeSymbol> types) : IReadOnlyList<GeneratedFile>GenerateNamespaceFile(string ns, IEnumerable<INamedTypeSymbol> types, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : GeneratedFileGetGuid(string className) : ValueTuple<string, string>
Eigenschaften
HasGuids : bool { get; }
DtoGenerationSymbols
class
Keine Beschreibung.
Konstruktoren
DtoGenerationSymbols()
Methoden
BuildMappingTargetTypeString(ITypeSymbol type, bool toNet, Dictionary<string, INamedTypeSymbol> comTypes, DtoGenerationSymbols symbols) : stringCollect(Compilation c, DtoGenerationConfig config) : DtoGenerationSymbolsContainsDtoTypeRecursive(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes) : boolFindTypesWithAttribute(Compilation compilation) : List<INamedTypeSymbol>FindTypesWithAttributeFromAllAssemblies(Compilation compilation, INamedTypeSymbol[] attributeTypes) : List<INamedTypeSymbol>GetBaseTypeString(INamedTypeSymbol type, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : stringGetBaseTypeString(INamedTypeSymbol type, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : stringGetBaseTypeString(INamedTypeSymbol type, string baseTypeStr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : stringGetBaseTypeString(INamedTypeSymbol type, string[] interfaces, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : stringGetClassCfgForType(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : AutoGenerateDtoAttributeGetDtoClassName(ITypeSymbol type, AutoGenerateDtoAttribute attr, bool asInterface) : stringGetDtoProperties(INamedTypeSymbol type, INamedTypeSymbol ignoreAttr) : IEnumerable<IPropertySymbol>GetDtoPropertiesDeep(INamedTypeSymbol type, INamedTypeSymbol ignoreAttr) : IEnumerable<IPropertySymbol>GetDtoPropertyName(IPropertySymbol prop, GenerationPropertySettingAttribute info) : stringGetDtoPropertyType(IPropertySymbol prop, Dictionary<string, INamedTypeSymbol> comTypes, DtoGenerationSymbols symbols, bool asInterface) : stringGetGenericTypeParameters(INamedTypeSymbol type) : stringGetGenericTypeParameters(ITypeSymbol type) : stringGetNamespaceForProperty(IPropertySymbol property, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : stringGetNamespacePrefixString(AutoGenerateDtoAttribute classCfg) : stringGetNamespacePrefixString(string namespace) : stringGetQualifiedDtoTypeName(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes, DtoGenerationSymbols symbols, bool asInterfaceForNonGeneric) : stringGetReferencedNamespaces(INamedTypeSymbol type, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : IEnumerable<string>GetToDtoMethodName(ISymbol type, AutoGenerateDtoAttribute attr) : stringGetToSourceMethodName(ISymbol type, AutoGenerateDtoAttribute attr) : stringGetUsings(IEnumerable<INamedTypeSymbol> types, Dictionary<string, INamedTypeSymbol> dtoTypeDict, AutoGenerateDtoAttribute autoGenAttr, DtoGenerationConfig cfg) : string[]GetUsings(INamedTypeSymbol type, Dictionary<string, INamedTypeSymbol> dtoTypeDict, AutoGenerateDtoAttribute autoGenAttr, DtoGenerationConfig cfg) : string[]IsDictionaryType(INamedTypeSymbol nts) : boolIsDtoEnumType(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes) : boolIsDtoType(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes) : boolIsSimpleEnumerableType(INamedTypeSymbol nts) : bool
Einfache Mengen-Typen (ohne Dictionary).PropertyInBaseType(IPropertySymbol prop, INamedTypeSymbol baseType, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : boolRegionNameFor(INamedTypeSymbol type, AutoGenerateDtoAttribute autoGenAttr) : stringResolveInterfaceAccess(IPropertySymbol prop, AutoGenerateDtoAttribute classAttr, DtoGenerationSymbols symbols) : InterfacePropertyTrimNullableSuffix(string typeName) : string
Hilfsroutine für Cast-Typnamen in expliziten Interface-Settern (Suffix '?' entfernen).
Eigenschaften
Config : DtoGenerationConfig { get; }
Felder
AutoGenerateDto : INamedTypeSymbolGenerateBeforeAndAfterAssignPartialsInMapping : INamedTypeSymbolIgnore : INamedTypeSymbolPropertySetting : INamedTypeSymbol
DtoGenerator
class
Keine Beschreibung.
Konstruktoren
DtoGenerator()DtoGenerator(DtoGenerationConfig config)
Methoden
Execute(Compilation compilation) : IEnumerable<GeneratedFile>Execute(GenerationContext context) : IEnumerable<GeneratedFile>Execute(GeneratorExecutionContext context) : IEnumerable<GeneratedFile>
Eigenschaften
RequireConfig : bool { get; }
Nextended.CodeGen.Generators.ExcelGeneration
ExcelStructureGenerator
class
Keine Beschreibung.
Konstruktoren
ExcelStructureGenerator()
Methoden
Execute(GenerationContext context) : IEnumerable<GeneratedFile>
Eigenschaften
RequireConfig : bool { get; }
Nextended.CodeGen.Generators.StructureGeneration
JsonClassGenerator
static class
Keine Beschreibung.
Methoden
GenerateClasses(string json, ClassStructureCodeGenerationConfig config) : string
StructureGenerator
class
Keine Beschreibung.
Konstruktoren
StructureGenerator()
Methoden
Execute(GenerationContext context) : IEnumerable<GeneratedFile>
Eigenschaften
RequireConfig : bool { get; }
XmlClassGenerator
static class
Keine Beschreibung.
Methoden
GenerateClasses(string xml, ClassStructureCodeGenerationConfig config) : string
Nextended.CodeGen.Helper
NamespaceResolver
class
Keine Beschreibung.
Konstruktoren
NamespaceResolver(AdditionalText file, Compilation compilation, AnalyzerConfigOptionsProvider optionsProvider)NamespaceResolver(AdditionalText file, GeneratorExecutionContext context)NamespaceResolver(string originFilePath, Compilation compilation, AnalyzerConfigOptionsProvider optionsProvider)NamespaceResolver(string originFilePath, GeneratorExecutionContext context)NamespaceResolver(string originFilePath, string fallBackRootNamespace, OptionsTryGetFunc optionsGetterFunc)
Methoden
EnsurePathEndsWithDirectorySeparator(string path) : stringGetAbsolutePath(string path, string basePath = null) : stringGetRelativePath(string fromPath, string toPath) : stringResolve() : string
OptionsTryGetFunc
delegate
Keine Beschreibung.
Konstruktoren
OptionsTryGetFunc(object object, IntPtr method)
Methoden
BeginInvoke(string key, out string value, AsyncCallback callback, object object) : IAsyncResultEndInvoke(out string value, IAsyncResult result) : boolInvoke(string key, out string value) : bool