Repository navigation
Expand file tree
/
Copy pathBuilderAndTargetInfo.cs
More file actions
50 lines (47 loc) · 2.22 KB
/
Copy pathBuilderAndTargetInfo.cs
File metadata and controls
50 lines (47 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using M31.FluentApi.Generator.Commons;
using M31.FluentApi.Generator.SourceGenerators;
using M31.FluentApi.Generator.SourceGenerators.Generics;
namespace M31.FluentApi.Generator.CodeGeneration.CodeBoardElements;
internal class BuilderAndTargetInfo
{
internal BuilderAndTargetInfo(
string fluentApiClassName,
string? @namespace,
GenericInfo? genericInfo,
bool fluentApiTypeIsStruct,
bool fluentApiTypeIsInternal,
ConstructorInfo fluentApiTypeConstructorInfo,
string builderClassName)
{
Namespace = @namespace;
FluentApiClassName = fluentApiClassName;
FluentApiClassNameWithTypeParameters =
ClassInfoFactory.AugmentTypeNameWithGenericParameters(fluentApiClassName, genericInfo);
GenericInfo = genericInfo;
FluentApiTypeIsStruct = fluentApiTypeIsStruct;
FluentApiTypeIsInternal = fluentApiTypeIsInternal;
DefaultAccessModifier = fluentApiTypeIsInternal ? "internal" : "public";
FluentApiTypeConstructorInfo = fluentApiTypeConstructorInfo;
BuilderClassName = builderClassName;
BuilderClassNameWithTypeParameters =
ClassInfoFactory.AugmentTypeNameWithGenericParameters(builderClassName, genericInfo);
BuilderInstanceName = builderClassName.FirstCharToLower();
ClassInstanceName = fluentApiClassName.FirstCharToLower();
InitialStepInterfaceName = $"I{builderClassName}";
FromExistingInterfaceName = $"I{builderClassName}FromExisting";
}
internal string? Namespace { get; }
internal string FluentApiClassName { get; }
internal string FluentApiClassNameWithTypeParameters { get; }
internal GenericInfo? GenericInfo { get; }
internal bool FluentApiTypeIsStruct { get; }
internal bool FluentApiTypeIsInternal { get; }
internal string DefaultAccessModifier { get; }
internal ConstructorInfo FluentApiTypeConstructorInfo { get; }
internal string BuilderClassName { get; }
internal string BuilderClassNameWithTypeParameters { get; }
internal string BuilderInstanceName { get; }
internal string ClassInstanceName { get; }
internal string InitialStepInterfaceName { get; }
internal string FromExistingInterfaceName { get; }
}