1 write to CollectionSource
Microsoft.Interop.SourceGeneration (1)
Marshalling\ElementsMarshalling.cs (1)
32
CollectionSource
= collectionSource;
53 references to CollectionSource
Microsoft.Interop.SourceGeneration (53)
Marshalling\ElementsMarshalling.cs (53)
37
writer.WriteLine($"{
CollectionSource
.GetUnmanagedValuesDestination(context)}.Clear();");
42
writer.WriteLine($"{
CollectionSource
.GetManagedValuesDestination(context)}.Clear();");
104
string source =
CollectionSource
.GetUnmanagedValuesSource(context);
106
writer.WriteLine($"{
CollectionSource
.GetManagedValuesDestination(context)}.CopyTo({destination});");
111
string destination = CastToManagedIfNecessary(
CollectionSource
.GetUnmanagedValuesDestination(context));
112
writer.WriteLine($"{
CollectionSource
.GetManagedValuesSource(context)}.CopyTo({destination});");
117
string source = CastToManagedIfNecessary(
CollectionSource
.GetUnmanagedValuesDestination(context));
118
string managedSource =
CollectionSource
.GetManagedValuesSource(context);
125
string source = CastToManagedIfNecessary(
CollectionSource
.GetUnmanagedValuesSource(context));
126
writer.WriteLine($"{source}.CopyTo({
CollectionSource
.GetManagedValuesDestination(context)});");
155
string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(
CollectionSource
.TypeInfo, context);
156
string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(
CollectionSource
.TypeInfo, context);
160
writer.WriteLine($"{TypeNames.System_ReadOnlySpan}<{elementMarshaller.TypeInfo.ManagedType.FullTypeName}> {managedSpanIdentifier} = {
CollectionSource
.GetManagedValuesSource(context)};");
161
writer.WriteLine($"{TypeNames.System_Span}<{unmanagedElementType}> {nativeSpanIdentifier} = {
CollectionSource
.GetUnmanagedValuesDestination(context)};");
164
if (ShouldCleanUpAllElements(
CollectionSource
.TypeInfo,
CollectionSource
.CodeContext))
175
string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(
CollectionSource
.TypeInfo, context);
176
string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(
CollectionSource
.TypeInfo, context);
180
writer.WriteLine($"{TypeNames.System_ReadOnlySpan}<{unmanagedElementType}> {nativeSpanIdentifier} = {
CollectionSource
.GetUnmanagedValuesSource(context)};");
181
writer.WriteLine($"{TypeNames.System_Span}<{elementMarshaller.TypeInfo.ManagedType.FullTypeName}> {managedSpanIdentifier} = {
CollectionSource
.GetManagedValuesDestination(context)};");
190
string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(
CollectionSource
.TypeInfo, context);
191
string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(
CollectionSource
.TypeInfo, context);
192
string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(
CollectionSource
.TypeInfo, context);
196
CollectionSource
.GenerateNumElementsAssignmentFromManagedValuesSource(writer,
CollectionSource
.TypeInfo, context);
197
writer.WriteLine($"{TypeNames.System_Span}<{elementMarshaller.TypeInfo.ManagedType.FullTypeName}> {managedSpanIdentifier} = {MemoryMarshalType}.CreateSpan(ref {UnsafeType}.AsRef(in {
CollectionSource
.GetManagedValuesSource(context)}.GetPinnableReference()), {numElementsIdentifier});");
198
writer.WriteLine($"{TypeNames.System_Span}<{unmanagedElementType}> {nativeSpanIdentifier} = {
CollectionSource
.GetUnmanagedValuesDestination(context)};");
206
string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(
CollectionSource
.TypeInfo, context);
207
bool usesLastIndexMarshalled = UsesLastIndexMarshalled(
CollectionSource
.TypeInfo,
CollectionSource
.CodeContext);
209
? MarshallerHelpers.GetLastIndexMarshalledIdentifier(
CollectionSource
.TypeInfo, context)
225
string source = MarshallerHelpers.GetMarshalDirection(
CollectionSource
.TypeInfo,
CollectionSource
.CodeContext) == MarshalDirection.ManagedToUnmanaged
226
?
CollectionSource
.GetUnmanagedValuesDestination(context)
227
:
CollectionSource
.GetUnmanagedValuesSource(context);
236
string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(
CollectionSource
.TypeInfo, context);
237
string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(
CollectionSource
.TypeInfo, context);
238
string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(
CollectionSource
.TypeInfo, context);
242
if (
CollectionSource
.CodeContext.Direction is MarshalDirection.UnmanagedToManaged &&
CollectionSource
.TypeInfo.ByValueContentsMarshalKind is ByValueContentsMarshalKind.Out)
253
CollectionSource
.GenerateNumElementsAssignmentFromManagedValuesDestination(writer,
CollectionSource
.TypeInfo, context);
254
writer.WriteLine($"{TypeNames.System_Span}<{unmanagedElementType}> {nativeSpanIdentifier} = {MemoryMarshalType}.CreateSpan(ref {UnsafeType}.AsRef(in {
CollectionSource
.GetUnmanagedValuesSource(context)}.GetPinnableReference()), {numElementsIdentifier});");
255
writer.WriteLine($"{TypeNames.System_Span}<{elementMarshaller.TypeInfo.ManagedType.FullTypeName}> {managedSpanIdentifier} = {
CollectionSource
.GetManagedValuesDestination(context)};");
268
string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(
CollectionSource
.TypeInfo, context);
269
string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(
CollectionSource
.TypeInfo, context);
270
StubCodeContext elementCodeContext = StubCodeContext.CreateElementMarshallingContext(
CollectionSource
.CodeContext);
335
if (UsesLastIndexMarshalled(
CollectionSource
.TypeInfo,
CollectionSource
.CodeContext)
338
incrementors += $", ++{MarshallerHelpers.GetLastIndexMarshalledIdentifier(
CollectionSource
.TypeInfo, context)}";
362
if (UsesLastIndexMarshalled(
CollectionSource
.TypeInfo,
CollectionSource
.CodeContext))
364
writer.WriteLine($"int {MarshallerHelpers.GetLastIndexMarshalledIdentifier(
CollectionSource
.TypeInfo, context)} = 0;");