3 instantiations of StubCodeContext
Microsoft.Interop.SourceGeneration (3)
StubCodeContext.cs (3)
31public static readonly StubCodeContext DefaultManagedToNativeStub = new( 36public static readonly StubCodeContext DefaultNativeToManagedStub = new( 43return new StubCodeContext(
115 references to StubCodeContext
Microsoft.Interop.ComInterfaceGenerator (30)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (6)
118ResolvedGenerator unmanagedToManagedGenerator = unmanagedToManagedFactory.Create(info, StubCodeContext.DefaultNativeToManagedStub); 119ResolvedGenerator managedToUnmanagedGenerator = managedToUnmanagedFactory.Create(info, StubCodeContext.DefaultManagedToNativeStub); 124}), StubCodeContext.DefaultManagedToNativeStub, forwarder, out var generatorDiagnostics); 188private readonly Func<TypePositionInfo, StubCodeContext, ResolvedGenerator> _func; 190public CallbackGeneratorResolver(Func<TypePositionInfo, StubCodeContext, ResolvedGenerator> func) 195public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) => _func(info, context);
Marshallers\ComInterfaceDispatchMarshallingResolver.cs (4)
19public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) 40public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext codeContext, StubIdentifierContext context) 66public ValueBoundaryBehavior GetValueBoundaryBehavior(TypePositionInfo info, StubCodeContext context) => ValueBoundaryBehavior.NativeIdentifier; 69public bool UsesNativeIdentifier(TypePositionInfo info, StubCodeContext context) => true;
Marshallers\KeepAliveThisMarshaller.cs (3)
18public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext codeContext, StubIdentifierContext context) 34public ValueBoundaryBehavior GetValueBoundaryBehavior(TypePositionInfo info, StubCodeContext context) => ValueBoundaryBehavior.ManagedIdentifier; 38public bool UsesNativeIdentifier(TypePositionInfo info, StubCodeContext context) => false;
Marshallers\ManagedHResultExceptionGeneratorResolver.cs (7)
18public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) 38public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext codeContext, StubIdentifierContext context) 57public ValueBoundaryBehavior GetValueBoundaryBehavior(TypePositionInfo info, StubCodeContext context) => ValueBoundaryBehavior.ManagedIdentifier; 60public bool UsesNativeIdentifier(TypePositionInfo info, StubCodeContext context) => false; 66public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext codeContext, StubIdentifierContext context) 94public ValueBoundaryBehavior GetValueBoundaryBehavior(TypePositionInfo info, StubCodeContext context) => ValueBoundaryBehavior.ManagedIdentifier; 97public bool UsesNativeIdentifier(TypePositionInfo info, StubCodeContext context) => false;
Marshallers\ObjectUnwrapperResolver.cs (4)
17public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) 34public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext codeContext, StubIdentifierContext context) 61public ValueBoundaryBehavior GetValueBoundaryBehavior(TypePositionInfo info, StubCodeContext context) => ValueBoundaryBehavior.NativeIdentifier; 64public bool UsesNativeIdentifier(TypePositionInfo info, StubCodeContext context) => true;
Marshallers\StructAsHResultMarshallerFactory.cs (4)
17public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) 32public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext codeContext, StubIdentifierContext context) 84public ValueBoundaryBehavior GetValueBoundaryBehavior(TypePositionInfo info, StubCodeContext context) 97public bool UsesNativeIdentifier(TypePositionInfo info, StubCodeContext context) => true;
UnmanagedToManagedStubGenerator.cs (2)
27_marshallers = BoundGenerators.Create(argTypes, generatorResolver, StubCodeContext.DefaultNativeToManagedStub, new Forwarder(), out var bindingDiagnostics); 54StubCodeContext.DefaultNativeToManagedStub,
Microsoft.Interop.JavaScript.JSImportGenerator (16)
JSExportCodeGenerator.cs (1)
33_marshallers = BoundGenerators.Create(argTypes, generatorResolver, StubCodeContext.DefaultNativeToManagedStub, new EmptyJSGenerator(), out var bindingFailures);
JSGeneratorFactory.cs (2)
16public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) 96internal static ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context, bool isToJs, KnownManagedType marshaledType, KnownManagedType[] argumentTypes, JSTypeFlags jsType, JSTypeFlags[] jsTypeArguments, Func<string, ResolvedGenerator> failWithReason)
JSImportCodeGenerator.cs (1)
40_marshallers = BoundGenerators.Create(argTypes, generatorResolver, StubCodeContext.DefaultManagedToNativeStub, new EmptyJSGenerator(), out var bindingFailures);
Marshaling\ArrayJSGenerator.cs (1)
16public ArrayJSGenerator(TypePositionInfo info, StubCodeContext context, MarshalerType elementMarshalerType)
Marshaling\ArraySegmentJSGenerator.cs (1)
15public ArraySegmentJSGenerator(TypePositionInfo info, StubCodeContext context, MarshalerType elementMarshalerType)
Marshaling\BaseJSGenerator.cs (1)
26public StubCodeContext CodeContext => _inner.CodeContext;
Marshaling\EmptyJSGenerator.cs (3)
13public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext codeContext, StubIdentifierContext identifierContext) => Array.Empty<StatementSyntax>(); 15public ValueBoundaryBehavior GetValueBoundaryBehavior(TypePositionInfo info, StubCodeContext context) => ValueBoundaryBehavior.ManagedIdentifier; 18public bool UsesNativeIdentifier(TypePositionInfo info, StubCodeContext context) => false;
Marshaling\FuncJSGenerator.cs (1)
19public FuncJSGenerator(TypePositionInfo info, StubCodeContext context, bool isAction, MarshalerType[] argumentMarshalerTypes)
Marshaling\NullableJSGenerator.cs (1)
13public NullableJSGenerator(TypePositionInfo info, StubCodeContext context, MarshalerType resultMarshalerType)
Marshaling\PrimitiveJSGenerator.cs (1)
19public PrimitiveJSGenerator(TypePositionInfo info, StubCodeContext context, MarshalerType marshalerType)
Marshaling\SpanJSGenerator.cs (1)
15public SpanJSGenerator(TypePositionInfo info, StubCodeContext context, MarshalerType elementMarshalerType)
Marshaling\TaskJSGenerator.cs (1)
16public TaskJSGenerator(TypePositionInfo info, StubCodeContext context, MarshalerType resultMarshalerType)
Marshaling\VoidGenerator.cs (1)
8internal sealed class VoidGenerator(TypePositionInfo info, StubCodeContext context, MarshalerType marshalerType) : BaseJSGenerator(marshalerType, new Forwarder().Bind(info, context));
Microsoft.Interop.LibraryImportGenerator (4)
Analyzers\ConvertToLibraryImportAnalyzer.cs (3)
170}), StubCodeContext.DefaultManagedToNativeStub, forwarder, out var bindingFailures); 230private sealed class CallbackGeneratorResolver(Func<TypePositionInfo, StubCodeContext, ResolvedGenerator> func) : IMarshallingGeneratorResolver 232public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) => func(info, context);
ForwarderResolver.cs (1)
14public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) => ResolvedGenerator.Resolved(s_forwarder.Bind(info, context));
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
ForwarderResolver.cs (1)
14public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) => ResolvedGenerator.Resolved(s_forwarder.Bind(info, context));
Microsoft.Interop.SourceGeneration (64)
BoundGenerators.cs (2)
21public static BoundGenerators Create(ImmutableArray<TypePositionInfo> elementTypeInfo, IMarshallingGeneratorResolver generatorResolver, StubCodeContext context, IUnboundMarshallingGenerator fallbackGenerator, out ImmutableArray<GeneratorDiagnostic> generatorBindingDiagnostics) 204public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context)
GeneratedStatements.cs (1)
48public static GeneratedStatements Create(BoundGenerators marshallers, StubCodeContext codeContext, StubIdentifierContext context, ExpressionSyntax expressionToInvoke)
ManagedToNativeStubGenerator.cs (2)
59_marshallers = BoundGenerators.Create(argTypes, generatorResolver, StubCodeContext.DefaultManagedToNativeStub, new Forwarder(), out var bindingDiagnostics); 111GeneratedStatements statements = GeneratedStatements.Create(_marshallers, StubCodeContext.DefaultManagedToNativeStub, _context, IdentifierName(targetIdentifier));
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (8)
43public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) 65private GeneratorDiagnostic.NotSupported? ValidateCountInfo(TypePositionInfo info, CountInfo count, StubCodeContext context, out bool countInfoRequiresCast) 131private CustomTypeMarshallerData GetMarshallerDataForTypePositionInfo(CustomTypeMarshallers marshallers, TypePositionInfo info, StubCodeContext context) 144private ResolvedGenerator CreateCustomNativeTypeMarshaller(TypePositionInfo info, StubCodeContext context, NativeMarshallingAttributeInfo marshalInfo) 208StubCodeContext context, 221StubCodeContext.CreateElementMarshallingContext(context)); 366private static FreeStrategy GetFreeStrategy(TypePositionInfo info, StubCodeContext context) 417private GeneratorDiagnostic.NotSupported? ValidateCustomNativeTypeMarshallingSupported(TypePositionInfo info, StubCodeContext context, NativeMarshallingAttributeInfo marshalInfo)
Marshalling\BlittableMarshaller.cs (3)
24public ValueBoundaryBehavior GetValueBoundaryBehavior(TypePositionInfo info, StubCodeContext context) 37public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext codeContext, StubIdentifierContext context) 97public bool UsesNativeIdentifier(TypePositionInfo info, StubCodeContext context)
Marshalling\BlittableMarshallerResolver.cs (1)
23public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context)
Marshalling\BoolMarshaller.cs (3)
40public ValueBoundaryBehavior GetValueBoundaryBehavior(TypePositionInfo info, StubCodeContext context) 50public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext codeContext, StubIdentifierContext context) 98public bool UsesNativeIdentifier(TypePositionInfo info, StubCodeContext context) => true;
Marshalling\BreakingChangeDetector.cs (1)
17public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context)
Marshalling\ByValueContentsMarshalKindValidator.cs (2)
22public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) 28private static ResolvedGenerator ValidateByValueMarshalKind(ResolvedGenerator generator, StubCodeContext context)
Marshalling\CharMarshaller.cs (4)
18public ValueBoundaryBehavior GetValueBoundaryBehavior(TypePositionInfo info, StubCodeContext context) 47public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext codeContext, StubIdentifierContext context) 123public bool UsesNativeIdentifier(TypePositionInfo info, StubCodeContext context) 129private static bool IsPinningPathSupported(TypePositionInfo info, StubCodeContext context)
Marshalling\CharMarshallingGeneratorResolver.cs (2)
24public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) 34private ResolvedGenerator CreateCharMarshaller(TypePositionInfo info, StubCodeContext context)
Marshalling\CompositeMarshallingGeneratorResolver.cs (1)
26public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context)
Marshalling\CustomTypeMarshallingGenerator.cs (1)
24public StubCodeContext CodeContext => nativeTypeMarshaller.CodeContext;
Marshalling\DelegateMarshaller.cs (3)
25public ValueBoundaryBehavior GetValueBoundaryBehavior(TypePositionInfo info, StubCodeContext context) 30public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext codeContext, StubIdentifierContext context) 93public bool UsesNativeIdentifier(TypePositionInfo info, StubCodeContext context) => true;
Marshalling\ElementsMarshalling.cs (2)
19StubCodeContext CodeContext { get; } 62public static ExpressionSyntax GenerateNumElementsExpression(CountInfo count, bool countInfoRequiresCast, StubCodeContext codeContext, StubIdentifierContext context)
Marshalling\Forwarder.cs (3)
22public ValueBoundaryBehavior GetValueBoundaryBehavior(TypePositionInfo info, StubCodeContext context) 27public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext codeContext, StubIdentifierContext context) 32public bool UsesNativeIdentifier(TypePositionInfo info, StubCodeContext context) => false;
Marshalling\ICustomTypeMarshallingStrategy.cs (1)
16StubCodeContext CodeContext { get; }
Marshalling\IMarshallingGeneratorResolver.cs (1)
18StubCodeContext context);
Marshalling\MarshalAsMarshallingGeneratorResolver.cs (1)
36StubCodeContext context)
Marshalling\MarshallerHelpers.cs (5)
94public static ExpressionSyntax GetIndexedManagedElementExpression(TypePositionInfo info, StubCodeContext codeContext, StubIdentifierContext context) 105internal static bool CanUseCallerAllocatedBuffer(TypePositionInfo info, StubCodeContext context) 291/// Get the marshalling direction for a given <see cref="TypePositionInfo"/> in a given <see cref="StubCodeContext"/>. 298public static MarshalDirection GetMarshalDirection(TypePositionInfo info, StubCodeContext context) 353public static StubIdentifierContext.Stage GetCleanupStage(TypePositionInfo info, StubCodeContext context)
Marshalling\MarshallingGenerator.cs (3)
93StubCodeContext CodeContext { get; } 156internal sealed class BoundMarshallingGenerator(TypePositionInfo info, StubCodeContext context, IUnboundMarshallingGenerator unbound) : IBoundMarshallingGenerator 164public StubCodeContext CodeContext => context;
Marshalling\NoMarshallingInfoErrorResolver.cs (1)
16StubCodeContext context)
Marshalling\NotSupportedResolver.cs (1)
8public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) =>
Marshalling\ResolvedGenerator.cs (1)
25public static ResolvedGenerator NotSupported(TypePositionInfo info, StubCodeContext context, GeneratorDiagnostic.NotSupported notSupportedDiagnostic)
Marshalling\StatefulMarshallingStrategy.cs (2)
13internal sealed class StatefulValueMarshalling(TypePositionInfo info, StubCodeContext stubContext, ManagedTypeInfo marshallerType, ManagedTypeInfo unmanagedType, MarshallerShape shape) : ICustomTypeMarshallingStrategy 23public StubCodeContext CodeContext => stubContext;
Marshalling\StatelessMarshallingStrategy.cs (2)
17internal sealed class StatelessValueMarshalling(TypePositionInfo info, StubCodeContext codeContext, TypeSyntax marshallerTypeSyntax, ManagedTypeInfo unmanagedType, MarshallerShape shape) : ICustomTypeMarshallingStrategy 25public StubCodeContext CodeContext => codeContext;
Marshalling\StaticPinnableManagedValueMarshaller.cs (2)
17public StubCodeContext CodeContext => innerMarshallingGenerator.CodeContext; 67private bool IsPinningPathSupported(StubCodeContext context)
Marshalling\UnmanagedToManagedOwnershipTrackingStrategy.cs (1)
25public StubCodeContext CodeContext => innerMarshaller.CodeContext;
StubCodeContext.cs (4)
31public static readonly StubCodeContext DefaultManagedToNativeStub = new( 36public static readonly StubCodeContext DefaultNativeToManagedStub = new( 41public static StubCodeContext CreateElementMarshallingContext(StubCodeContext containingContext)