-
Notifications
You must be signed in to change notification settings - Fork 107
/
Copy pathTestComponentCSharp.idl
760 lines (650 loc) · 29.1 KB
/
TestComponentCSharp.idl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
// Modern IDL 3.0: https://docs.microsoft.com/en-us/uwp/midl-3/intro
// TestComponentCSharp exercises cases specific to the C# language projection
// TestWinRT.TestComponent exercises cases general to all WinRT language projections
namespace TestComponentCSharp
{
// Event handlers
delegate void EventHandler0();
delegate void EventHandler1(Class sender);
delegate void EventHandler2(Class sender, Int32 arg0);
delegate void EventHandler3(Class sender, Int32 arg0, String arg1);
delegate void EventHandlerCollection(Class sender, Windows.Foundation.Collections.IVector<Int32> arg0, Windows.Foundation.Collections.IMap<Int32, String> arg1);
delegate Int32 EventWithReturn(Int32 arg);
delegate void EventWithGuid(Guid correlationGuid);
[flags]
enum FlagValue
{
One = 0x00000001,
All = 0xFFFFFFFF,
};
struct FlagStruct
{
FlagValue value;
};
enum EnumValue
{
One,
Two,
};
struct EnumStruct
{
EnumValue value;
};
struct BlittableStruct
{
Int32 i32;
};
struct ComposedBlittableStruct
{
BlittableStruct blittable;
};
struct NonBlittableStringStruct
{
String str;
};
struct NonBlittableBoolStruct
{
// Default C# behavior is to marshal as 32-bits, hence multiple values
Boolean w;
Boolean x;
Boolean y;
Boolean z;
};
struct NonBlittableRefStruct
{
Windows.Foundation.IReference<Int32> ref32;
};
struct ComposedNonBlittableStruct
{
BlittableStruct blittable;
NonBlittableStringStruct strings;
NonBlittableBoolStruct bools;
NonBlittableRefStruct refs;
};
delegate Int32 ProvideInt();
delegate Boolean ProvideBool();
delegate String ProvideString();
delegate Object ProvideObject();
delegate EnumValue ProvideEnum();
delegate EnumValue[] ProvideEnums();
delegate FlagValue ProvideFlag();
delegate FlagValue[] ProvideFlags();
delegate EnumStruct ProvideEnumStruct();
delegate EnumStruct[] ProvideEnumStructs();
delegate FlagStruct ProvideFlagStruct();
delegate FlagStruct[] ProvideFlagStructs();
delegate Windows.Foundation.Collections.IIterable<Object> ProvideObjectIterable();
delegate Windows.Foundation.Uri ProvideUri();
delegate Windows.Foundation.Collections.IKeyValuePair<String, String> ProvideStringPair();
delegate Microsoft.UI.Xaml.Interop.IBindableIterable ProvideBindableIterable();
delegate Microsoft.UI.Xaml.Interop.IBindableVector ProvideBindableVector();
interface ICowboy
{
void Draw();
void Draw(String gunModel);
String DrawTo();
}
interface IArtist
{
void Draw();
void Draw(Int32 figureSides);
Int32 DrawTo();
}
interface IProperties1
{
Int32 ReadWriteProperty{ get; };
//Int32 DisjointProperty{ get; };
//Int32 DistinctProperty{ get; };
}
interface IProperties2 requires IProperties1
{
[noexcept] Int32 ReadWriteProperty{ set; };
//String DisjointProperty{ set; };
//String DistinctProperty{ get; set; };
}
interface IUriHandler
{
void AddUriHandler(ProvideUri provideUri);
};
interface IBoolChanged
{
void InvokeBoolChanged(Windows.Foundation.EventHandler<Boolean> boolChanged);
};
static runtimeclass ComImports
{
static Object MakeObject();
static Int32 NumObjects{ get; };
}
interface IDerivedGenericInterface requires Microsoft.UI.Xaml.Input.ICommand, Microsoft.UI.Xaml.Interop.INotifyCollectionChanged, Windows.Foundation.Collections.IPropertySet
{
Int32 Number;
}
interface ISingleton
{
Int32 IntProperty;
event Windows.Foundation.EventHandler<Int32> IntPropertyChanged;
}
static runtimeclass Singleton
{
static ISingleton Instance;
}
[default_interface, gc_pressure(Windows.Foundation.Metadata.GCPressureAmount.High)]
runtimeclass Class :
Windows.Foundation.IStringable
//, ICowboy
//, IArtist
, IProperties1
, IProperties2
, Microsoft.UI.Xaml.Data.INotifyDataErrorInfo
, Microsoft.UI.Xaml.Input.ICommand
//, Windows.Foundation.Collections.IVector<String>
//, Windows.Foundation.Collections.IMap<Int32, String>
, IBoolChanged
{
// factory
Class();
Class(Int32 intProperty);
Class(Int32 intProperty, String stringProperty);
Windows.UI.Xaml.Interop.TypeName TypeProperty{ get; set; };
String GetTypePropertyAbiName();
String GetTypePropertyKind();
// static
static Int32 StaticIntProperty;
static event Windows.Foundation.EventHandler<Int32> StaticIntPropertyChanged;
static String StaticStringProperty;
static event Windows.Foundation.TypedEventHandler<Class, String> StaticStringPropertyChanged;
static void StaticGetString();
static void StaticSetString(ProvideString provideString);
static Int32 StaticReadWriteProperty{ get; };
static Int32 StaticReadWriteProperty{ set; };
static Windows.Foundation.TimeSpan FromSeconds(Int32 seconds);
static Windows.Foundation.DateTime Now();
// class
event EventHandler0 Event0;
void InvokeEvent0();
event EventHandler1 Event1;
void InvokeEvent1(Class sender);
event EventHandler2 Event2;
void InvokeEvent2(Class sender, Int32 arg0);
event EventHandler3 Event3;
void InvokeEvent3(Class sender, Int32 arg0, String arg1);
event EventHandlerCollection CollectionEvent;
event EventWithGuid GuidEvent;
void InvokeCollectionEvent(Class sender, Windows.Foundation.Collections.IVector<Int32> arg0, Windows.Foundation.Collections.IMap<Int32, String> arg1);
void InvokeGuidEvent(Guid correlationGuid);
event Windows.Foundation.EventHandler<Windows.Foundation.Collections.IVector<Int32> > NestedEvent;
void InvokeNestedEvent(Class sender, Windows.Foundation.Collections.IVector<Int32> arg0);
event Windows.Foundation.TypedEventHandler<Class, Windows.Foundation.Collections.IVector<String> > NestedTypedEvent;
void InvokeNestedTypedEvent(Class sender, Windows.Foundation.Collections.IVector<String> arg0);
event EventWithReturn ReturnEvent;
Int32 InvokeReturnEvent(Int32 arg0);
Guid TestReturnGuid(Guid arg);
event Microsoft.UI.Xaml.Data.PropertyChangedEventHandler PropertyChangedEventHandler;
Int32 IntProperty;
event Windows.Foundation.EventHandler<Int32> IntPropertyChanged;
void RaiseIntChanged();
void RemoveLastIntPropertyChangedHandler();
void CallForInt(ProvideInt provideInt);
Boolean BoolProperty;
event Windows.Foundation.EventHandler<Boolean> BoolPropertyChanged;
void RaiseBoolChanged();
void CallForBool(ProvideBool provideBool);
// Enums (oddly, arrays are not blittable - but all other structurings are)
EnumValue EnumProperty;
event Windows.Foundation.EventHandler<EnumValue> EnumPropertyChanged;
void RaiseEnumChanged();
void CallForEnum(ProvideEnum provide);
EnumStruct EnumStructProperty;
event Windows.Foundation.EventHandler<EnumStruct> EnumStructPropertyChanged;
void RaiseEnumStructChanged();
void CallForEnumStruct(ProvideEnumStruct provide);
EnumValue[] EnumsProperty;
void CallForEnums(ProvideEnums provide);
EnumStruct[] EnumStructsProperty;
void CallForEnumStructs(ProvideEnumStructs provide);
FlagValue FlagProperty;
event Windows.Foundation.EventHandler<FlagValue> FlagPropertyChanged;
void RaiseFlagChanged();
void CallForFlag(ProvideFlag provide);
FlagStruct FlagStructProperty;
event Windows.Foundation.EventHandler<FlagStruct> FlagStructPropertyChanged;
void RaiseFlagStructChanged();
void CallForFlagStruct(ProvideFlagStruct provide);
FlagValue[] FlagsProperty;
void CallForFlags(ProvideFlags provide);
FlagStruct[] FlagStructsProperty;
void CallForFlagStructs(ProvideFlagStructs provide);
String StringProperty;
event Windows.Foundation.TypedEventHandler<Class, String> StringPropertyChanged;
void RaiseStringChanged();
void CallForString(ProvideString provideString);
String StringProperty2;
Windows.Foundation.Collections.IVector<String> StringsProperty;
Object ObjectProperty;
void RaiseObjectChanged();
void CallForObject(ProvideObject provideObject);
event Windows.Foundation.EventHandler<Object> ObjectPropertyChanged;
Windows.Foundation.Collections.IIterable<Object> ObjectIterableProperty;
void RaiseObjectIterableChanged();
void CallForObjectIterable(ProvideObjectIterable provideObjectIterable);
event Windows.Foundation.EventHandler<Windows.Foundation.Collections.IIterable<Object> > ObjectIterablePropertyChanged;
Windows.Foundation.Collections.IIterable<Windows.Foundation.Collections.IIterable<Windows.Foundation.Point> > IterableOfPointIterablesProperty;
Windows.Foundation.Collections.IIterable<Windows.Foundation.Collections.IIterable<Object> > IterableOfObjectIterablesProperty;
Windows.Foundation.Uri UriProperty;
void RaiseUriChanged();
void CallForUri(ProvideUri provideUri);
event Windows.Foundation.EventHandler<Windows.Foundation.Uri> UriPropertyChanged;
Windows.Foundation.Collections.IKeyValuePair<String, String> StringPairProperty;
void RaiseStringPairChanged();
void CallForStringPair(ProvideStringPair provideStringPair);
event Windows.Foundation.EventHandler<Windows.Foundation.Collections.IKeyValuePair<String, String> > StringPairPropertyChanged;
Windows.Foundation.Collections.IVector<IInspectable> GetUriVectorAsIInspectableVector();
ProvideUri GetUriDelegate();
void AddUriHandler(IUriHandler uriHandler);
// Structs
BlittableStruct BlittableStructProperty;
BlittableStruct GetBlittableStruct();
void OutBlittableStruct(out BlittableStruct value);
void SetBlittableStruct(BlittableStruct value);
ComposedBlittableStruct ComposedBlittableStructProperty;
ComposedBlittableStruct GetComposedBlittableStruct();
void OutComposedBlittableStruct(out ComposedBlittableStruct value);
void SetComposedBlittableStruct(ComposedBlittableStruct value);
NonBlittableStringStruct NonBlittableStringStructProperty;
NonBlittableStringStruct GetNonBlittableStringStruct();
void OutNonBlittableStringStruct(out NonBlittableStringStruct value);
void SetNonBlittableStringStruct(NonBlittableStringStruct value);
NonBlittableBoolStruct NonBlittableBoolStructProperty;
NonBlittableBoolStruct GetNonBlittableBoolStruct();
void OutNonBlittableBoolStruct(out NonBlittableBoolStruct value);
void SetNonBlittableBoolStruct(NonBlittableBoolStruct value);
NonBlittableRefStruct NonBlittableRefStructProperty;
NonBlittableRefStruct GetNonBlittableRefStruct();
void OutNonBlittableRefStruct(out NonBlittableRefStruct value);
void SetNonBlittableRefStruct(NonBlittableRefStruct value);
ComposedNonBlittableStruct ComposedNonBlittableStructProperty;
ComposedNonBlittableStruct GetComposedNonBlittableStruct();
void OutComposedNonBlittableStruct(out ComposedNonBlittableStruct value);
void SetComposedNonBlittableStruct(ComposedNonBlittableStruct value);
// Arrays
void SetInts(Int32[] ints);
Int32[] GetInts();
void FillInts(ref Int32[] ints);
Windows.Foundation.HResult[] GetAndSetHResults(Windows.Foundation.HResult[] hresults);
Windows.Foundation.Uri[] GetAndSetUris(Windows.Foundation.Uri[] uris);
Windows.Foundation.DateTime[] GetAndSetDateTimes(Windows.Foundation.DateTime[] datetime);
// Generics
Windows.Foundation.IAsyncOperation<Int32> GetIntAsync();
Windows.Foundation.IAsyncOperationWithProgress<String, Int32> GetStringAsync();
Windows.Foundation.Collections.IVectorView<Int32> GetIntVector();
Windows.Foundation.Collections.IVectorView<Boolean> GetBoolVector();
Windows.Foundation.Collections.IVectorView<String> GetStringVector();
Windows.Foundation.Collections.IVectorView<ComposedBlittableStruct> GetBlittableStructVector();
Windows.Foundation.Collections.IVectorView<ComposedNonBlittableStruct> GetNonBlittableStructVector();
Windows.Foundation.Collections.IVectorView<Object> GetObjectVector();
Windows.Foundation.Collections.IVectorView<IProperties1> GetInterfaceVector();
[noexcept] Windows.Foundation.Collections.IVectorView<Class> GetClassVector();
Windows.Foundation.Collections.IVector<Int32> GetIntVector2();
Windows.Foundation.Collections.IVector<ComposedBlittableStruct> GetBlittableStructVector2();
Windows.Foundation.Collections.IVector<ComposedNonBlittableStruct> GetNonBlittableStructVector2();
Windows.Foundation.Collections.IMap<Int32, Int32> GetIntToIntDictionary();
Windows.Foundation.Collections.IMap<String, ComposedBlittableStruct> GetStringToBlittableDictionary();
Windows.Foundation.Collections.IMap<String, ComposedNonBlittableStruct> GetStringToNonBlittableDictionary();
Windows.Foundation.Collections.IMap<ComposedBlittableStruct, Object> GetBlittableToObjectDictionary();
Windows.Foundation.Collections.IMap<Int32, Windows.Foundation.Collections.IVector<EnumValue> > GetIntToListDictionary();
// Test IIDOptimizer
Windows.Foundation.Collections.IVectorView<Microsoft.UI.Xaml.Data.DataErrorsChangedEventArgs> GetEventArgsVector();
Windows.Foundation.Collections.IVectorView<ProvideUri> GetNonGenericDelegateVector();
Windows.Foundation.Collections.IIterable<Int32> GetIntIterable();
void SetIntIterable(Windows.Foundation.Collections.IIterable<Int32> value);
void SetCharIterable(Windows.Foundation.Collections.IIterable<Char> value);
Windows.Foundation.Collections.IIterable<EnumValue> GetEnumIterable();
Windows.Foundation.Collections.IIterable<CustomDisposableTest> GetClassIterable();
Windows.Foundation.Collections.IIterator<Int32> GetIteratorForCollection(Windows.Foundation.Collections.IIterable<Int32> iterable);
// Bindable
Microsoft.UI.Xaml.Interop.IBindableIterable BindableIterableProperty;
void RaiseBindableIterableChanged();
void CallForBindableIterable(ProvideBindableIterable provideBindableIterable);
event Windows.Foundation.EventHandler<Microsoft.UI.Xaml.Interop.IBindableIterable> BindableIterablePropertyChanged;
Microsoft.UI.Xaml.Interop.IBindableVector BindableVectorProperty;
void RaiseBindableVectorChanged();
void CallForBindableVector(ProvideBindableVector provideBindableVector);
event Windows.Foundation.EventHandler<Microsoft.UI.Xaml.Interop.IBindableVector> BindableVectorPropertyChanged;
Microsoft.UI.Xaml.Interop.IBindableObservableVector BindableObservableVectorProperty;
Microsoft.UI.Xaml.Interop.IBindableObservableVector GetBindableObservableVector(Microsoft.UI.Xaml.Interop.IBindableObservableVector vector);
Boolean ValidateBindableProperty(
Object bindableObject,
String property,
Windows.UI.Xaml.Interop.TypeName indexerType,
Boolean validateOnlyExists,
Boolean canRead,
Boolean canWrite,
Boolean isIndexer,
Windows.UI.Xaml.Interop.TypeName type,
Object indexerValue,
Object setValue,
out Object retrievedValue);
void CopyProperties(IProperties1 src);
void CopyPropertiesViaWeakReference(IProperties1 src);
// Async
void CompleteAsync(); // Completes the in-flight async operation successfully
void CompleteAsync(Int32 hr); // Completes the in-flight async operation with a failed HRESULT
void AdvanceAsync(Int32 delta); // "Advances" the progress of an in-flight IAsync*WithProgress by an amount
Windows.Foundation.IAsyncAction DoitAsync();
Windows.Foundation.IAsyncActionWithProgress<Int32> DoitAsyncWithProgress();
Windows.Foundation.IAsyncOperation<Int32> AddAsync(Int32 lhs, Int32 rhs);
Windows.Foundation.IAsyncOperationWithProgress<Int32, Int32> AddAsyncWithProgress(Int32 lhs, Int32 rhs);
// Type mappings
// "Simple" structs (blittable with changes to add properties/functions/constructors/etc.)
Windows.Foundation.Point PointProperty;
Windows.Foundation.IReference<Windows.Foundation.Point> GetPointReference();
Windows.Foundation.Rect RectProperty;
Windows.Foundation.Size SizeProperty;
Windows.UI.Color ColorProperty;
Microsoft.UI.Xaml.CornerRadius CornerRadiusProperty;
Microsoft.UI.Xaml.Duration DurationProperty;
Microsoft.UI.Xaml.GridLength GridLengthProperty;
Microsoft.UI.Xaml.Thickness ThicknessProperty;
Microsoft.UI.Xaml.Controls.Primitives.GeneratorPosition GeneratorPositionProperty;
Microsoft.UI.Xaml.Media.Matrix MatrixProperty;
Microsoft.UI.Xaml.Media.Animation.KeyTime KeyTimeProperty;
Microsoft.UI.Xaml.Media.Animation.RepeatBehavior RepeatBehaviorProperty;
Microsoft.UI.Xaml.Media.Media3D.Matrix3D Matrix3DProperty;
Windows.Foundation.Numerics.Matrix3x2 Matrix3x2Property;
Windows.Foundation.Numerics.Matrix4x4 Matrix4x4Property;
Windows.Foundation.Numerics.Plane PlaneProperty;
Windows.Foundation.Numerics.Quaternion QuaternionProperty;
Windows.Foundation.Numerics.Vector2 Vector2Property;
Windows.Foundation.Numerics.Vector3 Vector3Property;
Windows.Foundation.Numerics.Vector4 Vector4Property;
Windows.Foundation.IReference<Windows.Foundation.Numerics.Vector3> Vector3NullableProperty;
// Structs mapped to equivalent ones in the System namespace
Windows.Foundation.TimeSpan TimeSpanProperty;
Windows.Foundation.IReference<Windows.Foundation.TimeSpan> GetTimeSpanReference();
Windows.Foundation.DateTime DateTimeProperty;
Windows.Foundation.IReference<Windows.Foundation.DateTime> GetDateTimeProperty();
// HResult->Exception type mapping
Windows.Foundation.HResult HResultProperty;
Double Calculate(Windows.Foundation.Collections.IVector<Windows.Foundation.IReference<Double> > values);
Windows.Foundation.Collections.IVector<Windows.Foundation.IReference<Int32> > GetNullableIntList();
// Boxing
static Int32 UnboxInt32(Object obj);
static Boolean UnboxBoolean(Object obj);
static String UnboxString(Object obj);
static ProvideInt UnboxDelegate(Object obj);
static EnumValue UnboxEnum(Object obj);
static Windows.UI.Xaml.Interop.TypeName UnboxType(Object obj);
static Int32[] UnboxInt32Array(Object obj);
static Boolean[] UnboxBooleanArray(Object obj);
static String[] UnboxStringArray(Object obj);
static Object BoxedDelegate{ get; };
static Object BoxedEnum{ get; };
static Object BoxedEventHandler{ get; };
static void UnboxAndCallProgressHandler(Object httpProgressHandler);
static Int32 GetPropertyType(Object obj);
static String GetName(Object obj);
// WUX.Interop.TypeName -> System.Type mapping
static Windows.UI.Xaml.Interop.TypeName Int32Type { get; };
static Windows.UI.Xaml.Interop.TypeName ThisClassType { get; };
static Windows.UI.Xaml.Interop.TypeName ReferenceInt32Type { get; };
static Object BoxedType{ get; };
static Windows.Foundation.Collections.IVector<Windows.UI.Xaml.Interop.TypeName> ListOfTypes{ get; };
static Boolean VerifyTypeIsInt32Type(Windows.UI.Xaml.Interop.TypeName type);
static Boolean VerifyTypeIsThisClassType(Windows.UI.Xaml.Interop.TypeName type);
static Boolean VerifyTypeIsReferenceInt32Type(Windows.UI.Xaml.Interop.TypeName type);
static String GetTypeNameForType(Windows.UI.Xaml.Interop.TypeName type);
// Other
static Object EmptyString { get; };
// Keyword escapes
String Catch(String params, out String lock);
String ThrowExceptionWithMessage(String message, Boolean throwNonMappedError);
String OriginateAndThrowExceptionWithMessage(String message);
// Interface projections
static IProperties1 NativeProperties1{ get; };
static Object ServiceProvider{ get; };
static Object ComInterop{ get; };
static Windows.Foundation.Collections.IPropertySet PropertySet{ get; };
// INotifyDataErrorInfo
void RaiseDataErrorChanged();
// ICommand
void RaiseCanExecuteChanged();
static Object BadRuntimeClassName{ get; };
}
runtimeclass ABCDEFGHIJKLMNOPQRSTUVQXYZabcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVQXYZabcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
{
ABCDEFGHIJKLMNOPQRSTUVQXYZabcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVQXYZabcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz();
event Windows.Foundation.TypedEventHandler<ABCDEFGHIJKLMNOPQRSTUVQXYZabcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVQXYZabcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz, ABCDEFGHIJKLMNOPQRSTUVQXYZabcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVQXYZabcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz> EventForAVeryLongClassName;
void InvokeEvent();
}
[threading(sta), marshaling_behavior(standard)]
runtimeclass NonAgileClass
{
NonAgileClass();
void Observe(Microsoft.UI.Xaml.Interop.IBindableObservableVector vector);
}
[default_interface]
runtimeclass CustomBindableIteratorTest : Microsoft.UI.Xaml.Interop.IBindableIterator
{
CustomBindableIteratorTest();
}
[default_interface]
runtimeclass CustomDisposableTest : Windows.Foundation.IClosable
{
CustomDisposableTest();
}
[default_interface]
runtimeclass CustomBindableVectorTest : Microsoft.UI.Xaml.Interop.IBindableVector
{
CustomBindableVectorTest();
}
[default_interface]
runtimeclass CustomBindableObservableVectorTest : Microsoft.UI.Xaml.Interop.IBindableObservableVector
{
CustomBindableObservableVectorTest();
}
[default_interface]
runtimeclass CustomIteratorTest : Windows.Foundation.Collections.IIterator<Int32>
{
CustomIteratorTest();
CustomIteratorTest(Windows.Foundation.Collections.IIterator<Int32> iterator);
}
[default_interface]
runtimeclass CustomIterableTest : Windows.Foundation.Collections.IIterable<Int32>
{
CustomIterableTest();
CustomIterableTest(Windows.Foundation.Collections.IIterable<Int32> iterable);
static CustomIterableTest CreateWithCustomIterator();
}
// SupportedOSPlatform warning tests
[contract(Windows.Foundation.UniversalApiContract, 10)]
[attributeusage(target_all)]
[attributename("warning")]
attribute WarningAttribute
{
};
[contract(Windows.Foundation.UniversalApiContract, 8)]
enum WarningEnum
{
Value,
[contract(Windows.Foundation.UniversalApiContract, 10)]
WarningValue
};
[contract(Windows.Foundation.UniversalApiContract, 10)]
struct WarningStruct
{
Int32 i32;
};
[contract(Windows.Foundation.UniversalApiContract, 8)]
static runtimeclass WarningStatic
{
static void Method();
static Int32 Property;
static event Windows.Foundation.EventHandler<Int32> Event;
static Int32 ReadWriteProperty{ get; };
[contract(Windows.Foundation.UniversalApiContract, 10)]
{
static void WarningMethod();
static Int32 WarningProperty;
static event Windows.Foundation.EventHandler<Int32> WarningEvent;
static Int32 ReadWriteProperty{ set; };
}
}
[contract(Windows.Foundation.UniversalApiContract, 8)]
interface IWarning1
{
Int32 WarningInterfacePropertySetter{ get; };
}
[contract(Windows.Foundation.UniversalApiContract, 10)]
interface IWarning2 requires IWarning1
{
void WarningInterfaceMethod();
Int32 WarningInterfaceProperty;
Int32 WarningInterfacePropertySetter{ set; };
event Windows.Foundation.EventHandler<Int32> WarningInterfaceEvent;
}
[default_interface]
[contract(Windows.Foundation.UniversalApiContract, 8)]
unsealed runtimeclass WarningClass : IWarning1, IWarning2
{
Int32 WarningPropertySetter{ get; };
[contract(Windows.Foundation.UniversalApiContract, 10)]
{
WarningClass();
WarningClass(WarningEnum arg);
void WarningMethod();
Int32 WarningProperty;
Int32 WarningPropertySetter{ set; };
event Windows.Foundation.EventHandler<Int32> WarningEvent;
overridable void WarningOverridableMethod();
overridable Int32 WarningOverridableProperty;
// see https://github.com/microsoft/cppwinrt/issues/782
//overridable event Windows.Foundation.EventHandler<Int32> WarningOverridableEvent;
}
}
[attributeusage(target_runtimeclass, target_interface, target_struct, target_enum, target_delegate, target_field, target_property, target_method, target_event)]
[attributename("attr_string")]
attribute MyStringAttribute
{
String Content;
}
[attr_string(
"This is line one
This is line two
And this is another one"
)]
runtimeclass MultiLineStringAttributeTest
{
void f();
}
[attr_string("a string with embedded escape characters, like the string \"quotes\" and string \\\"quotes\\\" and string \'char\'")]
runtimeclass EmbeddedQuotesTest
{
void f();
}
[default_interface]
runtimeclass CustomEquals
{
Int32 Value{ get; set; };
CustomEquals();
[default_overload]
Boolean Equals(Object obj);
Int32 GetHashCode();
Boolean Equals(CustomEquals other);
}
[default_interface]
runtimeclass CustomEquals2
{
Int32 Value{ get; set; };
CustomEquals2();
[default_overload]
Int32 Equals(Object obj);
Int32 Equals(CustomEquals2 other);
}
[default_interface]
unsealed runtimeclass UnSealedCustomEquals
{
Int32 Value{ get; set; };
UnSealedCustomEquals();
Int32 GetHashCode();
}
[default_interface]
runtimeclass DerivedCustomEquals : UnSealedCustomEquals
{
DerivedCustomEquals();
[default_overload]
Boolean Equals(Object obj);
Int32 GetHashCode();
Boolean Equals(UnSealedCustomEquals other);
}
[default_interface]
[experimental]
runtimeclass CustomExperimentClass
{
CustomExperimentClass();
Int32 Value{ get; set; };
void f();
}
[default_interface]
runtimeclass ClassWithExplicitIUnknown
{
ClassWithExplicitIUnknown();
ClassWithExplicitIUnknown(Int32 defaultValue);
Int32 Value{ get; set; };
}
// Compile time test for sub windows namespace
namespace Windows
{
runtimeclass Class
{
Class();
static void StaticMethod();
void Method();
void Method2(Windows.Foundation.IStringable stringable);
}
[contract(Windows.Foundation.UniversalApiContract, 8)]
interface IWarning
{
Int32 WarningInterfacePropertySetter{ get; };
event Windows.Foundation.TypedEventHandler<Class, String> StringPropertyChanged;
}
[contract(Windows.Foundation.UniversalApiContract, 10)]
[attributeusage(target_all)]
[attributename("warning2")]
attribute Warning2Attribute
{
};
}
// Compile time test for sub WinRT namespace
namespace WinRT
{
runtimeclass Class
{
Class();
static void StaticMethod();
void Method();
void Method2(Windows.Foundation.IStringable stringable);
}
}
namespace AnotherAssembly
{
[default_interface]
runtimeclass SetPropertyClass : TestComponentCSharp.IProperties1
{
SetPropertyClass();
Int32 ReadWriteProperty{ set; };
}
}
namespace TestPublicExclusiveTo
{
interface IRegularInterface
{
Int32 Type { get; };
}
// This is a test for runtimeclass which can be have its interfaces implemented by other consumers
unsealed runtimeclass NonUniqueClass : IRegularInterface
{
String Path{ get; };
static Int32 StaticProperty { get; };
}
}
}