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.

@Sergio0694 Sergio0694 force-pushed the user/sergiopedri/dynamic-type-map-entries branch from 3757ab3 to 75ad766 Compare November 1, 2025 19:27
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.
@Sergio0694 Sergio0694 force-pushed the user/sergiopedri/dynamic-type-map-entries branch from b0c1b5d to 84d4c68 Compare November 1, 2025 19:35
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.
Replaces PropertyChangedEventHandler.CreateTypeReference with SystemObjectModel.CreateTypeReference for INotifyDataErrorInfo, ensuring the correct method is used to create the TypeReference.
…solete

Added Obsolete and EditorBrowsable attributes to BindableIReadOnlyListAdapterComWrappersMarshallerAttribute to indicate it is deprecated and should not be used in new code.
@Sergio0694 Sergio0694 merged commit 79fae59 into staging/3.0 Nov 1, 2025
10 checks passed
@Sergio0694 Sergio0694 deleted the user/sergiopedri/dynamic-type-map-entries branch November 1, 2025 19:56
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.

3 participants