Skip to content

Nextended.CodeGen — API-Referenz

🇬🇧 This page in English

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.

Zurück zur Paketseite

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) : void
  • ReportDiagnostic(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 include using directives for namespaces
  • AddReferencedNamespacesUsings : bool? { get; set; }
    Gets or sets a value indicating whether to include using directives 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 ids
  • ComIdClassPropertyFormat : 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

  • Html
  • Markdown
  • PlainText
  • value__

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) : GeneratedFile
  • GenerateClass(INamedTypeSymbol type, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool addGeneric) : string
  • GenerateComIdFile(IEnumerable<INamedTypeSymbol> allTypes) : GeneratedFile
  • GenerateEnum(INamedTypeSymbol enumType, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : string
  • GenerateGuids() : string
  • GenerateInterface(INamedTypeSymbol type, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool addGeneric) : string
  • GenerateMappingExtensions(List<INamedTypeSymbol> types) : IReadOnlyList<GeneratedFile>
  • GenerateNamespaceFile(string ns, IEnumerable<INamedTypeSymbol> types, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : GeneratedFile
  • GetGuid(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) : string
  • Collect(Compilation c, DtoGenerationConfig config) : DtoGenerationSymbols
  • ContainsDtoTypeRecursive(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes) : bool
  • FindTypesWithAttribute(Compilation compilation) : List<INamedTypeSymbol>
  • FindTypesWithAttributeFromAllAssemblies(Compilation compilation, INamedTypeSymbol[] attributeTypes) : List<INamedTypeSymbol>
  • GetBaseTypeString(INamedTypeSymbol type, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : string
  • GetBaseTypeString(INamedTypeSymbol type, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : string
  • GetBaseTypeString(INamedTypeSymbol type, string baseTypeStr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : string
  • GetBaseTypeString(INamedTypeSymbol type, string[] interfaces, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : string
  • GetClassCfgForType(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : AutoGenerateDtoAttribute
  • GetDtoClassName(ITypeSymbol type, AutoGenerateDtoAttribute attr, bool asInterface) : string
  • GetDtoProperties(INamedTypeSymbol type, INamedTypeSymbol ignoreAttr) : IEnumerable<IPropertySymbol>
  • GetDtoPropertiesDeep(INamedTypeSymbol type, INamedTypeSymbol ignoreAttr) : IEnumerable<IPropertySymbol>
  • GetDtoPropertyName(IPropertySymbol prop, GenerationPropertySettingAttribute info) : string
  • GetDtoPropertyType(IPropertySymbol prop, Dictionary<string, INamedTypeSymbol> comTypes, DtoGenerationSymbols symbols, bool asInterface) : string
  • GetGenericTypeParameters(INamedTypeSymbol type) : string
  • GetGenericTypeParameters(ITypeSymbol type) : string
  • GetNamespaceForProperty(IPropertySymbol property, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : string
  • GetNamespacePrefixString(AutoGenerateDtoAttribute classCfg) : string
  • GetNamespacePrefixString(string namespace) : string
  • GetQualifiedDtoTypeName(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes, DtoGenerationSymbols symbols, bool asInterfaceForNonGeneric) : string
  • GetReferencedNamespaces(INamedTypeSymbol type, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : IEnumerable<string>
  • GetToDtoMethodName(ISymbol type, AutoGenerateDtoAttribute attr) : string
  • GetToSourceMethodName(ISymbol type, AutoGenerateDtoAttribute attr) : string
  • GetUsings(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) : bool
  • IsDtoEnumType(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes) : bool
  • IsDtoType(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes) : bool
  • IsSimpleEnumerableType(INamedTypeSymbol nts) : bool
    Einfache Mengen-Typen (ohne Dictionary).
  • PropertyInBaseType(IPropertySymbol prop, INamedTypeSymbol baseType, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : bool
  • RegionNameFor(INamedTypeSymbol type, AutoGenerateDtoAttribute autoGenAttr) : string
  • ResolveInterfaceAccess(IPropertySymbol prop, AutoGenerateDtoAttribute classAttr, DtoGenerationSymbols symbols) : InterfaceProperty
  • TrimNullableSuffix(string typeName) : string
    Hilfsroutine für Cast-Typnamen in expliziten Interface-Settern (Suffix '?' entfernen).

Eigenschaften

  • Config : DtoGenerationConfig { get; }

Felder

  • AutoGenerateDto : INamedTypeSymbol
  • GenerateBeforeAndAfterAssignPartialsInMapping : INamedTypeSymbol
  • Ignore : INamedTypeSymbol
  • PropertySetting : 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) : string
  • GetAbsolutePath(string path, string basePath = null) : string
  • GetRelativePath(string fromPath, string toPath) : string
  • Resolve() : string

OptionsTryGetFunc

delegate

Keine Beschreibung.

Konstruktoren

  • OptionsTryGetFunc(object object, IntPtr method)

Methoden

  • BeginInvoke(string key, out string value, AsyncCallback callback, object object) : IAsyncResult
  • EndInvoke(out string value, IAsyncResult result) : bool
  • Invoke(string key, out string value) : bool

Zurück zur Paketseite