You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/standard/native-interop/custom-marshalling-source-generation.md
+31-13Lines changed: 31 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,20 +45,34 @@ public struct Example
45
45
}
46
46
```
47
47
48
-
`ExampleMarshaller`, the entry-point marshaller type, is marked with <xref:System.Runtime.InteropServices.Marshalling.CustomMarshallerAttribute>, pointing at a [marshaller implementation](#marshaller-implementation) type. In this example, `ExampleMarshaller` is both the entry point and the implementation. It conforms to [marshaller shapes][value_shapes] expected for custom marshalling of a value.
48
+
`ExampleMarshaller`, the entry-point marshaller type, is marked with <xref:System.Runtime.InteropServices.Marshalling.CustomMarshallerAttribute>, pointing at a [marshaller implementation](#marshaller-implementation) type. In this example, `ExampleMarshaller` is both the entry point and the implementation. It conforms to [marshaller shapes][value_shapes] expected for custom marshalling of a value. Note that `ExampleMarshaller` assumes UTF-8 string encoding.
@@ -89,33 +103,37 @@ internal static partial Example ConvertExample(Example example);
89
103
90
104
Apply the <xref:System.Runtime.InteropServices.Marshalling.ContiguousCollectionMarshallerAttribute> to a marshaller entry-point type to indicate that it's for contiguous collections. The type must have one more type parameter than the associated managed type. The last type parameter is a placeholder and will be filled in by the source generator with the unmanaged type for the collection's element type.
91
105
92
-
For example, you can specify custom marshalling for a <xref:System.Collections.Generic.List%601>. In the following code, `ListMarshaller` is both the entry point and the implementation. It conforms to [marshaller shapes][collection_shapes] expected for custom marshalling of a collection.
106
+
For example, you can specify custom marshalling for a <xref:System.Collections.Generic.List%601>. In the following code, `ListMarshaller` is both the entry point and the implementation. It conforms to [marshaller shapes][collection_shapes] expected for custom marshalling of a collection. Note that it is an incomplete example.
0 commit comments