forked from microsoft/CsWinRT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAttributes.cs
More file actions
124 lines (111 loc) · 3.67 KB
/
Attributes.cs
File metadata and controls
124 lines (111 loc) · 3.67 KB
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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
namespace WinRT
{
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
#if EMBED
internal
#else
public
#endif
sealed class ProjectedRuntimeClassAttribute : Attribute
{
public ProjectedRuntimeClassAttribute(string defaultInterfaceProp)
{
DefaultInterfaceProperty = defaultInterfaceProp;
}
public ProjectedRuntimeClassAttribute(Type defaultInterface)
{
DefaultInterface = defaultInterface;
}
public string DefaultInterfaceProperty { get; }
public Type DefaultInterface { get; }
}
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
#if EMBED
internal
#else
public
#endif
sealed class ObjectReferenceWrapperAttribute : Attribute
{
public ObjectReferenceWrapperAttribute(string objectReferenceField)
{
ObjectReferenceField = objectReferenceField;
}
public string ObjectReferenceField { get; }
}
/// <summary>
/// When applied to a type, designates to WinRT.Runtime that this type represents a type defined in WinRT metadata.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Delegate | AttributeTargets.Struct | AttributeTargets.Enum, Inherited = false, AllowMultiple = false)]
#if EMBED
internal
#else
public
#endif
sealed class WindowsRuntimeTypeAttribute : Attribute
{
public WindowsRuntimeTypeAttribute(string sourceMetadata = null)
{
SourceMetadata = sourceMetadata;
}
public string SourceMetadata { get; }
}
/// <summary>
/// When applied to a type, it specifies the provided type, if one is provided, is the ABI helper type for this type.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Delegate | AttributeTargets.Struct | AttributeTargets.Enum, Inherited = false, AllowMultiple = false)]
#if EMBED
internal
#else
public
#endif
sealed class WindowsRuntimeHelperTypeAttribute : Attribute
{
// Indicates no associated helper types (i.e. blittable types).
public WindowsRuntimeHelperTypeAttribute()
{
}
public WindowsRuntimeHelperTypeAttribute(
#if NET
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.PublicFields)]
#endif
Type helperType)
{
HelperType = helperType;
}
#if NET
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.PublicFields)]
#endif
public Type HelperType { get; }
}
}
namespace System.Runtime.InteropServices.WindowsRuntime
{
[AttributeUsage(System.AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
#if EMBED
internal
#else
public
#endif
sealed class ReadOnlyArrayAttribute : Attribute
{
}
[AttributeUsage(System.AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
#if EMBED
internal
#else
public
#endif
sealed class WriteOnlyArrayAttribute : Attribute
{
}
}