@@ -964,63 +964,5 @@ public bool IsBlittable()
964964 return isValueType && isBlittable ;
965965 }
966966 }
967-
968- // Based on whether System.Type is used in an attribute declaration or elsewhere, we need to choose the correct custom mapping
969- // as attributes don't use the TypeName mapping.
970- internal static ( string , string , string , bool , bool ) GetSystemTypeCustomMapping ( ISymbol containingSymbol )
971- {
972- bool isDefinedInAttribute =
973- containingSymbol != null &&
974- string . CompareOrdinal ( ( containingSymbol as INamedTypeSymbol ) . BaseType ? . ToString ( ) , "System.Attribute" ) == 0 ;
975- return isDefinedInAttribute ?
976- ( "System" , "Type" , "mscorlib" , true , false ) :
977- ( "Windows.UI.Xaml.Interop" , "TypeName" , "Windows.Foundation.UniversalApiContract" , false , true ) ;
978- }
979-
980- // This should be in sync with the reverse mapping from WinRT.Runtime/Projections.cs and cswinrt/helpers.h.
981- public static readonly Dictionary < string , MappedType > MappedCSharpTypes = new ( StringComparer . Ordinal )
982- {
983- { "System.DateTimeOffset" , new MappedType ( "Windows.Foundation" , "DateTime" , "Windows.Foundation.FoundationContract" , true , false ) } ,
984- { "System.Exception" , new MappedType ( "Windows.Foundation" , "HResult" , "Windows.Foundation.FoundationContract" , true , false ) } ,
985- { "System.EventHandler`1" , new MappedType ( "Windows.Foundation" , "EventHandler`1" , "Windows.Foundation.FoundationContract" ) } ,
986- { "System.FlagsAttribute" , new MappedType ( "System" , "FlagsAttribute" , "mscorlib" ) } ,
987- { "System.IDisposable" , new MappedType ( "Windows.Foundation" , "IClosable" , "Windows.Foundation.FoundationContract" ) } ,
988- { "System.IServiceProvider" , new MappedType ( "Microsoft.UI.Xaml" , "IXamlServiceProvider" , "Microsoft.UI" ) } ,
989- { "System.Nullable`1" , new MappedType ( "Windows.Foundation" , "IReference`1" , "Windows.Foundation.FoundationContract" ) } ,
990- { "System.Object" , new MappedType ( "System" , "Object" , "mscorlib" ) } ,
991- { "System.TimeSpan" , new MappedType ( "Windows.Foundation" , "TimeSpan" , "Windows.Foundation.FoundationContract" , true , false ) } ,
992- { "System.Uri" , new MappedType ( "Windows.Foundation" , "Uri" , "Windows.Foundation.FoundationContract" ) } ,
993- { "System.ComponentModel.DataErrorsChangedEventArgs" , new MappedType ( "Microsoft.UI.Xaml.Data" , "DataErrorsChangedEventArgs" , "Microsoft.UI" ) } ,
994- { "System.ComponentModel.INotifyDataErrorInfo" , new MappedType ( "Microsoft.UI.Xaml.Data" , "INotifyDataErrorInfo" , "Microsoft.UI" ) } ,
995- { "System.ComponentModel.INotifyPropertyChanged" , new MappedType ( "Microsoft.UI.Xaml.Data" , "INotifyPropertyChanged" , "Microsoft.UI" ) } ,
996- { "System.ComponentModel.PropertyChangedEventArgs" , new MappedType ( "Microsoft.UI.Xaml.Data" , "PropertyChangedEventArgs" , "Microsoft.UI" ) } ,
997- { "System.ComponentModel.PropertyChangedEventHandler" , new MappedType ( "Microsoft.UI.Xaml.Data" , "PropertyChangedEventHandler" , "Microsoft.UI" ) } ,
998- { "System.Windows.Input.ICommand" , new MappedType ( "Microsoft.UI.Xaml.Input" , "ICommand" , "Microsoft.UI" ) } ,
999- { "System.Collections.IEnumerable" , new MappedType ( "Microsoft.UI.Xaml.Interop" , "IBindableIterable" , "Microsoft.UI" ) } ,
1000- { "System.Collections.IList" , new MappedType ( "Microsoft.UI.Xaml.Interop" , "IBindableVector" , "Microsoft.UI" ) } ,
1001- { "System.Collections.Specialized.INotifyCollectionChanged" , new MappedType ( "Microsoft.UI.Xaml.Interop" , "INotifyCollectionChanged" , "Microsoft.UI" ) } ,
1002- { "System.Collections.Specialized.NotifyCollectionChangedAction" , new MappedType ( "Microsoft.UI.Xaml.Interop" , "NotifyCollectionChangedAction" , "Microsoft.UI" ) } ,
1003- { "System.Collections.Specialized.NotifyCollectionChangedEventArgs" , new MappedType ( "Microsoft.UI.Xaml.Interop" , "NotifyCollectionChangedEventArgs" , "Microsoft.UI" ) } ,
1004- { "System.Collections.Specialized.NotifyCollectionChangedEventHandler" , new MappedType ( "Microsoft.UI.Xaml.Interop" , "NotifyCollectionChangedEventHandler" , "Microsoft.UI" ) } ,
1005- { "WinRT.EventRegistrationToken" , new MappedType ( "Windows.Foundation" , "EventRegistrationToken" , "Windows.Foundation.FoundationContract" , true , true ) } ,
1006- { "System.AttributeTargets" , new MappedType ( "Windows.Foundation.Metadata" , "AttributeTargets" , "Windows.Foundation.FoundationContract" , true , true ) } ,
1007- { "System.AttributeUsageAttribute" , new MappedType ( "Windows.Foundation.Metadata" , "AttributeUsageAttribute" , "Windows.Foundation.FoundationContract" ) } ,
1008- { "System.Numerics.Matrix3x2" , new MappedType ( "Windows.Foundation.Numerics" , "Matrix3x2" , "Windows.Foundation.FoundationContract" , true , true ) } ,
1009- { "System.Numerics.Matrix4x4" , new MappedType ( "Windows.Foundation.Numerics" , "Matrix4x4" , "Windows.Foundation.FoundationContract" , true , true ) } ,
1010- { "System.Numerics.Plane" , new MappedType ( "Windows.Foundation.Numerics" , "Plane" , "Windows.Foundation.FoundationContract" , true , true ) } ,
1011- { "System.Numerics.Quaternion" , new MappedType ( "Windows.Foundation.Numerics" , "Quaternion" , "Windows.Foundation.FoundationContract" , true , true ) } ,
1012- { "System.Numerics.Vector2" , new MappedType ( "Windows.Foundation.Numerics" , "Vector2" , "Windows.Foundation.FoundationContract" , true , true ) } ,
1013- { "System.Numerics.Vector3" , new MappedType ( "Windows.Foundation.Numerics" , "Vector3" , "Windows.Foundation.FoundationContract" , true , true ) } ,
1014- { "System.Numerics.Vector4" , new MappedType ( "Windows.Foundation.Numerics" , "Vector4" , "Windows.Foundation.FoundationContract" , true , true ) } ,
1015- { "System.Type" , new MappedType ( GetSystemTypeCustomMapping ) } ,
1016- { "System.Collections.Generic.IEnumerable`1" , new MappedType ( "Windows.Foundation.Collections" , "IIterable`1" , "Windows.Foundation.FoundationContract" ) } ,
1017- { "System.Collections.Generic.IEnumerator`1" , new MappedType ( "Windows.Foundation.Collections" , "IIterator`1" , "Windows.Foundation.FoundationContract" ) } ,
1018- { "System.Collections.Generic.KeyValuePair`2" , new MappedType ( "Windows.Foundation.Collections" , "IKeyValuePair`2" , "Windows.Foundation.FoundationContract" ) } ,
1019- { "System.Collections.Generic.IReadOnlyDictionary`2" , new MappedType ( "Windows.Foundation.Collections" , "IMapView`2" , "Windows.Foundation.FoundationContract" ) } ,
1020- { "System.Collections.Generic.IDictionary`2" , new MappedType ( "Windows.Foundation.Collections" , "IMap`2" , "Windows.Foundation.FoundationContract" ) } ,
1021- { "System.Collections.Generic.IReadOnlyList`1" , new MappedType ( "Windows.Foundation.Collections" , "IVectorView`1" , "Windows.Foundation.FoundationContract" ) } ,
1022- { "System.Collections.Generic.IList`1" , new MappedType ( "Windows.Foundation.Collections" , "IVector`1" , "Windows.Foundation.FoundationContract" ) } ,
1023- { "Windows.UI.Color" , new MappedType ( "Windows.UI" , "Color" , "Windows.Foundation.UniversalApiContract" , true , true ) } ,
1024- } ;
1025967 }
1026968}
0 commit comments