1 write to CollectionSource
Microsoft.Interop.SourceGeneration (1)
Marshalling\ElementsMarshalling.cs (1)
31
CollectionSource
= collectionSource;
53 references to CollectionSource
Microsoft.Interop.SourceGeneration (53)
Marshalling\ElementsMarshalling.cs (53)
36
writer.WriteLine($"{
CollectionSource
.GetUnmanagedValuesDestination(context)}.Clear();");
41
writer.WriteLine($"{
CollectionSource
.GetManagedValuesDestination(context)}.Clear();");
103
string source =
CollectionSource
.GetUnmanagedValuesSource(context);
105
writer.WriteLine($"{
CollectionSource
.GetManagedValuesDestination(context)}.CopyTo({destination});");
110
string destination = CastToManagedIfNecessary(
CollectionSource
.GetUnmanagedValuesDestination(context));
111
writer.WriteLine($"{
CollectionSource
.GetManagedValuesSource(context)}.CopyTo({destination});");
116
string source = CastToManagedIfNecessary(
CollectionSource
.GetUnmanagedValuesDestination(context));
117
string managedSource =
CollectionSource
.GetManagedValuesSource(context);
124
string source = CastToManagedIfNecessary(
CollectionSource
.GetUnmanagedValuesSource(context));
125
writer.WriteLine($"{source}.CopyTo({
CollectionSource
.GetManagedValuesDestination(context)});");
154
string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(
CollectionSource
.TypeInfo, context);
155
string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(
CollectionSource
.TypeInfo, context);
159
writer.WriteLine($"{TypeNames.System_ReadOnlySpan}<{elementMarshaller.TypeInfo.ManagedType.FullTypeName}> {managedSpanIdentifier} = {
CollectionSource
.GetManagedValuesSource(context)};");
160
writer.WriteLine($"{TypeNames.System_Span}<{unmanagedElementType}> {nativeSpanIdentifier} = {
CollectionSource
.GetUnmanagedValuesDestination(context)};");
163
if (ShouldCleanUpAllElements(
CollectionSource
.TypeInfo,
CollectionSource
.CodeContext))
174
string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(
CollectionSource
.TypeInfo, context);
175
string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(
CollectionSource
.TypeInfo, context);
179
writer.WriteLine($"{TypeNames.System_ReadOnlySpan}<{unmanagedElementType}> {nativeSpanIdentifier} = {
CollectionSource
.GetUnmanagedValuesSource(context)};");
180
writer.WriteLine($"{TypeNames.System_Span}<{elementMarshaller.TypeInfo.ManagedType.FullTypeName}> {managedSpanIdentifier} = {
CollectionSource
.GetManagedValuesDestination(context)};");
189
string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(
CollectionSource
.TypeInfo, context);
190
string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(
CollectionSource
.TypeInfo, context);
191
string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(
CollectionSource
.TypeInfo, context);
195
CollectionSource
.GenerateNumElementsAssignmentFromManagedValuesSource(writer,
CollectionSource
.TypeInfo, context);
196
writer.WriteLine($"{TypeNames.System_Span}<{elementMarshaller.TypeInfo.ManagedType.FullTypeName}> {managedSpanIdentifier} = {MemoryMarshalType}.CreateSpan(ref {UnsafeType}.AsRef(in {
CollectionSource
.GetManagedValuesSource(context)}.GetPinnableReference()), {numElementsIdentifier});");
197
writer.WriteLine($"{TypeNames.System_Span}<{unmanagedElementType}> {nativeSpanIdentifier} = {
CollectionSource
.GetUnmanagedValuesDestination(context)};");
205
string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(
CollectionSource
.TypeInfo, context);
206
bool usesLastIndexMarshalled = UsesLastIndexMarshalled(
CollectionSource
.TypeInfo,
CollectionSource
.CodeContext);
208
? MarshallerHelpers.GetLastIndexMarshalledIdentifier(
CollectionSource
.TypeInfo, context)
224
string source = MarshallerHelpers.GetMarshalDirection(
CollectionSource
.TypeInfo,
CollectionSource
.CodeContext) == MarshalDirection.ManagedToUnmanaged
225
?
CollectionSource
.GetUnmanagedValuesDestination(context)
226
:
CollectionSource
.GetUnmanagedValuesSource(context);
235
string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(
CollectionSource
.TypeInfo, context);
236
string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(
CollectionSource
.TypeInfo, context);
237
string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(
CollectionSource
.TypeInfo, context);
241
if (
CollectionSource
.CodeContext.Direction is MarshalDirection.UnmanagedToManaged &&
CollectionSource
.TypeInfo.ByValueContentsMarshalKind is ByValueContentsMarshalKind.Out)
252
CollectionSource
.GenerateNumElementsAssignmentFromManagedValuesDestination(writer,
CollectionSource
.TypeInfo, context);
253
writer.WriteLine($"{TypeNames.System_Span}<{unmanagedElementType}> {nativeSpanIdentifier} = {MemoryMarshalType}.CreateSpan(ref {UnsafeType}.AsRef(in {
CollectionSource
.GetUnmanagedValuesSource(context)}.GetPinnableReference()), {numElementsIdentifier});");
254
writer.WriteLine($"{TypeNames.System_Span}<{elementMarshaller.TypeInfo.ManagedType.FullTypeName}> {managedSpanIdentifier} = {
CollectionSource
.GetManagedValuesDestination(context)};");
267
string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(
CollectionSource
.TypeInfo, context);
268
string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(
CollectionSource
.TypeInfo, context);
269
StubCodeContext elementCodeContext = StubCodeContext.CreateElementMarshallingContext(
CollectionSource
.CodeContext);
334
if (UsesLastIndexMarshalled(
CollectionSource
.TypeInfo,
CollectionSource
.CodeContext)
337
incrementors += $", ++{MarshallerHelpers.GetLastIndexMarshalledIdentifier(
CollectionSource
.TypeInfo, context)}";
361
if (UsesLastIndexMarshalled(
CollectionSource
.TypeInfo,
CollectionSource
.CodeContext))
363
writer.WriteLine($"int {MarshallerHelpers.GetLastIndexMarshalledIdentifier(
CollectionSource
.TypeInfo, context)} = 0;");