Skip to content

Conversation

@Sergio0694
Copy link
Member

This PR moves the registration of proxy types and type map entries for custom-mapped types that change runtime class names between WUX and MUX to cswinrtgen, so that only the correct things are registered depending on the runtime configuration.

Introduces the DefineDynamicCustomMappedTypeMapEntries method to handle dynamic type map entries for custom-mapped types in the interop generator. Adds a new well-known exception for errors during this process and updates comments for clarity regarding custom-mapped types.
Moved WindowsRuntimeComWrappers type map assembly attributes for IEnumerable, IEnumerator, IList, NotifyCollectionChangedEventArgs, and PropertyChangedEventArgs from ABI classes to a new DynamicCustomMappedTypeMapEntriesBuilder in the generator. Updated ABI classes to be obsolete, editor-browsable never, and public static. Added missing type references in InteropReferences for IList, NotifyCollectionChangedEventArgs, and PropertyChangedEventArgs.
This commit updates method signatures and calls to use fully qualified names for types in the ABI.System.Collections and related namespaces. It also removes unnecessary using directives, improving clarity and reducing ambiguity in type references.
Updated several methods in InteropTypeDefinitionBuilder from public to private to restrict their visibility and encapsulate implementation details. This change improves encapsulation and clarifies intended usage within the class.
Extracted repetitive logic for adding type map custom attributes into a new private helper method, TypeMapAttribute, to reduce code duplication and improve maintainability in DynamicCustomMappedTypeMapEntriesBuilder.
Replaces direct marshaller attribute and method references with fully qualified ABI namespace usage throughout the codebase. Also marks BindableIReadOnlyListAdapter as obsolete and updates related attributes for improved clarity and maintainability.
Updated various files to remove unnecessary global:: and ABI namespace prefixes, use direct type references, and improve clarity in XML documentation. Adjusted marshaller and interface references for BindableIReadOnlyListAdapter and Point to use more concise and consistent naming. These changes improve code readability and maintainability.
Introduces WindowsRuntimeExposedType for NotifyCollectionChangedEventHandler, PropertyChangedEventHandler, and BindableIReadOnlyListAdapter in DynamicCustomMappedTypeMapEntriesBuilder. Updates InteropReferences to expose new type references, makes InteropTypeDefinitionBuilder.Proxy public, and refines ABI implementations for these types to remove assembly-level TypeMap attributes and improve marshaller attribute visibility and documentation.
Refactored DefineDynamicCustomMappedTypeMapEntries to accept InteropGeneratorArgs and InteropReferences instead of InteropDefinitions. Updated call sites and XML documentation to match the new parameters, improving clarity and flexibility for dynamic type map entry generation.
Ensure type references and constructors are imported into the current module before resolving or using them. This addresses potential issues with type resolution and attribute instantiation in code generation.
Updated type references for System.Collections.Specialized and System.ComponentModel types to use the new SystemObjectModel assembly reference instead of CorLibScope. Added SystemObjectModel as an assembly reference to improve accuracy and maintainability.
Deleted TypeMap assembly attributes mapping IBindableIterator interfaces to ABI.System.Collections.IEnumerator. This simplifies the mapping configuration and removes references to Windows.UI.Xaml.Interop and Microsoft.UI.Xaml.Interop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants