-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
ReadOnlyAttribute.xml
536 lines (502 loc) · 33.1 KB
/
ReadOnlyAttribute.xml
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
<Type Name="ReadOnlyAttribute" FullName="System.ComponentModel.ReadOnlyAttribute">
<TypeSignature Language="C#" Value="public sealed class ReadOnlyAttribute : Attribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ReadOnlyAttribute extends System.Attribute" />
<TypeSignature Language="DocId" Value="T:System.ComponentModel.ReadOnlyAttribute" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class ReadOnlyAttribute
Inherits Attribute" />
<TypeSignature Language="F#" Value="type ReadOnlyAttribute = class
 inherit Attribute" />
<TypeSignature Language="C++ CLI" Value="public ref class ReadOnlyAttribute sealed : Attribute" />
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Primitives</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.ComponentModel.Primitives" ToVersion="5.0.0.0" FrameworkAlternate="net-5.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.ComponentModel.Primitives" ToVersion="6.0.0.0" FrameworkAlternate="net-6.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.ComponentModel.Primitives" ToVersion="7.0.0.0" FrameworkAlternate="net-7.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.ComponentModel.Primitives" ToVersion="8.0.0.0" FrameworkAlternate="net-8.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.ComponentModel.Primitives" ToVersion="9.0.0.0" FrameworkAlternate="net-9.0" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.Attribute</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-3.0;netcore-3.1;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0;netstandard-2.1">
<AttributeName Language="C#">[System.AttributeUsage(System.AttributeTargets.All)]</AttributeName>
<AttributeName Language="F#">[<System.AttributeUsage(System.AttributeTargets.All)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NullableContext(1)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NullableContext(1)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Specifies whether the property this attribute is bound to is read-only or read/write. This class cannot be inherited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Members that are marked with the <xref:System.ComponentModel.ReadOnlyAttribute> set to `true` or that do not have a `Set` method cannot be changed. Members that do not have this attribute or that are marked with the <xref:System.ComponentModel.ReadOnlyAttribute> set to `false` are read/write, and they can be changed. The default is <xref:System.ComponentModel.ReadOnlyAttribute.No>.
> [!IMPORTANT]
> The <xref:System.ComponentModel.PropertyDescriptor> class enforces the <xref:System.ComponentModel.ReadOnlyAttribute> in the design environment and at run time. When you mark a property with the <xref:System.ComponentModel.ReadOnlyAttribute> set to `true`, the value of this attribute is set to the constant member <xref:System.ComponentModel.ReadOnlyAttribute.Yes>. For a property marked with the <xref:System.ComponentModel.ReadOnlyAttribute> set to `false`, the value is <xref:System.ComponentModel.ReadOnlyAttribute.No>. Therefore, when you want to check the value of this attribute in your code, you must specify the attribute as <xref:System.ComponentModel.ReadOnlyAttribute.Yes?displayProperty=nameWithType> or <xref:System.ComponentModel.ReadOnlyAttribute.No?displayProperty=nameWithType>.
For more information, see [Attributes](/dotnet/standard/attributes/).
## Examples
The following code example marks a property as read-only.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic ReadOnlyAttribute Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/ReadOnlyAttribute/Overview/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic ReadOnlyAttribute Example/VB/source.vb" id="Snippet1":::
The next code example shows how to check the value of the <xref:System.ComponentModel.ReadOnlyAttribute> for `MyProperty`. First, the code gets a <xref:System.ComponentModel.PropertyDescriptorCollection> with all the properties for the object. Next, it indexes into the <xref:System.ComponentModel.PropertyDescriptorCollection> to get `MyProperty`. Then it returns the attributes for this property and saves them in the attributes variable.
The example presents two different ways of checking the value of the <xref:System.ComponentModel.ReadOnlyAttribute>. In the second code fragment, the example calls the <xref:System.ComponentModel.ReadOnlyAttribute.Equals%2A> method. In the last code fragment, the example uses the <xref:System.ComponentModel.ReadOnlyAttribute.IsReadOnly%2A> property to check the value.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic ReadOnlyAttribute Example/CPP/source.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/ReadOnlyAttribute/Overview/source.cs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic ReadOnlyAttribute Example/VB/source.vb" id="Snippet2":::
If you marked a class with the <xref:System.ComponentModel.ReadOnlyAttribute>, use the following code example to check the value.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic ReadOnlyAttribute Example/CPP/source.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/ReadOnlyAttribute/Overview/source.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic ReadOnlyAttribute Example/VB/source.vb" id="Snippet3":::
]]></format>
</remarks>
<altmember cref="T:System.Attribute" />
<altmember cref="T:System.ComponentModel.PropertyDescriptor" />
<altmember cref="T:System.ComponentModel.AttributeCollection" />
<altmember cref="T:System.ComponentModel.PropertyDescriptorCollection" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ReadOnlyAttribute (bool isReadOnly);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(bool isReadOnly) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.ReadOnlyAttribute.#ctor(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (isReadOnly As Boolean)" />
<MemberSignature Language="F#" Value="new System.ComponentModel.ReadOnlyAttribute : bool -> System.ComponentModel.ReadOnlyAttribute" Usage="new System.ComponentModel.ReadOnlyAttribute isReadOnly" />
<MemberSignature Language="C++ CLI" Value="public:
 ReadOnlyAttribute(bool isReadOnly);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Primitives</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="isReadOnly" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="isReadOnly">
<see langword="true" /> to show that the property this attribute is bound to is read-only; <see langword="false" /> to show that the property is read/write.</param>
<summary>Initializes a new instance of the <see cref="T:System.ComponentModel.ReadOnlyAttribute" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Members that are marked with the <xref:System.ComponentModel.ReadOnlyAttribute> set to `true` or that do not have a `Set` method cannot be changed. Members that do not have this attribute or that are marked with the <xref:System.ComponentModel.ReadOnlyAttribute> set to `false` are read/write, and they can be changed. The default is <xref:System.ComponentModel.ReadOnlyAttribute.No>.
> [!NOTE]
> When you mark a property with the <xref:System.ComponentModel.ReadOnlyAttribute> set to `true`, the value of this attribute is set to the constant member <xref:System.ComponentModel.ReadOnlyAttribute.Yes>. For a property marked with the <xref:System.ComponentModel.ReadOnlyAttribute> set to `false`, the value is <xref:System.ComponentModel.ReadOnlyAttribute.No>. Therefore, when you want to check the value of this attribute in your code, you must specify the attribute as <xref:System.ComponentModel.ReadOnlyAttribute.Yes?displayProperty=nameWithType> or <xref:System.ComponentModel.ReadOnlyAttribute.No?displayProperty=nameWithType>.
## Examples
The following code example marks a property as read-only. This code creates a new <xref:System.ComponentModel.ReadOnlyAttribute>, sets its value to <xref:System.ComponentModel.ReadOnlyAttribute.Yes?displayProperty=nameWithType>, and binds it to the property.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic ReadOnlyAttribute.ReadOnlyAttribute Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/ReadOnlyAttribute/.ctor/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic ReadOnlyAttribute.ReadOnlyAttribute Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.ComponentModel.ReadOnlyAttribute" />
</Docs>
</Member>
<Member MemberName="Default">
<MemberSignature Language="C#" Value="public static readonly System.ComponentModel.ReadOnlyAttribute Default;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.ComponentModel.ReadOnlyAttribute Default" />
<MemberSignature Language="DocId" Value="F:System.ComponentModel.ReadOnlyAttribute.Default" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly Default As ReadOnlyAttribute " />
<MemberSignature Language="F#" Value=" staticval mutable Default : System.ComponentModel.ReadOnlyAttribute" Usage="System.ComponentModel.ReadOnlyAttribute.Default" />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::ComponentModel::ReadOnlyAttribute ^ Default;" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Primitives</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.ComponentModel.ReadOnlyAttribute</ReturnType>
</ReturnValue>
<Docs>
<summary>Specifies the default value for the <see cref="T:System.ComponentModel.ReadOnlyAttribute" />, which is <see cref="F:System.ComponentModel.ReadOnlyAttribute.No" /> (that is, the property this attribute is bound to is read/write). This <see langword="static" /> field is read-only.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When you mark a property with this value, this attribute is set to the constant member <xref:System.ComponentModel.ReadOnlyAttribute.No>. Therefore, when you want to check whether the attribute is set to this value in your code, you must specify the attribute as <xref:System.ComponentModel.ReadOnlyAttribute.No?displayProperty=nameWithType>.
]]></format>
</remarks>
<altmember cref="T:System.ComponentModel.ReadOnlyAttribute" />
<altmember cref="F:System.ComponentModel.ReadOnlyAttribute.Yes" />
<altmember cref="F:System.ComponentModel.ReadOnlyAttribute.No" />
</Docs>
</Member>
<Member MemberName="Equals">
<MemberSignature Language="C#" Value="public override bool Equals (object? value);" FrameworkAlternate="net-5.0;net-6.0;net-7.0;net-8.0;net-9.0" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool Equals(object value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.ReadOnlyAttribute.Equals(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function Equals (value As Object) As Boolean" />
<MemberSignature Language="F#" Value="override this.Equals : obj -> bool" Usage="readOnlyAttribute.Equals value" />
<MemberSignature Language="C++ CLI" Value="public:
 override bool Equals(System::Object ^ value);" />
<MemberSignature Language="C#" Value="public override bool Equals (object value);" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0;netstandard-2.1" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Primitives</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NullableContext(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NullableContext(2)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Object">
<Attributes>
<Attribute FrameworkAlternate="net-6.0;net-7.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Diagnostics.CodeAnalysis.NotNullWhen(true)]</AttributeName>
<AttributeName Language="F#">[<System.Diagnostics.CodeAnalysis.NotNullWhen(true)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="value">Another object to compare to.</param>
<summary>Indicates whether this instance and a specified object are equal.</summary>
<returns>
<see langword="true" /> if <paramref name="value" /> is equal to this instance; otherwise, <see langword="false" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="GetHashCode">
<MemberSignature Language="C#" Value="public override int GetHashCode ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetHashCode() cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.ReadOnlyAttribute.GetHashCode" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetHashCode () As Integer" />
<MemberSignature Language="F#" Value="override this.GetHashCode : unit -> int" Usage="readOnlyAttribute.GetHashCode " />
<MemberSignature Language="C++ CLI" Value="public:
 override int GetHashCode();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Primitives</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the hash code for this instance.</summary>
<returns>A hash code for the current <see cref="T:System.ComponentModel.ReadOnlyAttribute" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="IsDefaultAttribute">
<MemberSignature Language="C#" Value="public override bool IsDefaultAttribute ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool IsDefaultAttribute() cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.ReadOnlyAttribute.IsDefaultAttribute" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function IsDefaultAttribute () As Boolean" />
<MemberSignature Language="F#" Value="override this.IsDefaultAttribute : unit -> bool" Usage="readOnlyAttribute.IsDefaultAttribute " />
<MemberSignature Language="C++ CLI" Value="public:
 override bool IsDefaultAttribute();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Primitives</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Determines if this attribute is the default.</summary>
<returns>
<see langword="true" /> if the attribute is the default value for this attribute class; otherwise, <see langword="false" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="IsReadOnly">
<MemberSignature Language="C#" Value="public bool IsReadOnly { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsReadOnly" />
<MemberSignature Language="DocId" Value="P:System.ComponentModel.ReadOnlyAttribute.IsReadOnly" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property IsReadOnly As Boolean" />
<MemberSignature Language="F#" Value="member this.IsReadOnly : bool" Usage="System.ComponentModel.ReadOnlyAttribute.IsReadOnly" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool IsReadOnly { bool get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Primitives</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether the property this attribute is bound to is read-only.</summary>
<value>
<see langword="true" /> if the property this attribute is bound to is read-only; <see langword="false" /> if the property is read/write.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example checks to see whether `MyProperty` is read-only. First, the code gets the attributes for `MyProperty` by doing the following:
- Retrieving a <xref:System.ComponentModel.PropertyDescriptorCollection> with all the properties for the object.
- Indexing into the <xref:System.ComponentModel.PropertyDescriptorCollection> to get `MyProperty`.
- Saving the attributes for this property in the attributes variable.
Then the code sets `myAttribute` to the value of the <xref:System.ComponentModel.ReadOnlyAttribute> in the <xref:System.ComponentModel.AttributeCollection> and checks whether the property is read-only.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic ReadOnlyAttribute.IsReadOnly Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/ReadOnlyAttribute/IsReadOnly/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic ReadOnlyAttribute.IsReadOnly Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.ComponentModel.ReadOnlyAttribute" />
<altmember cref="T:System.Attribute" />
<altmember cref="T:System.ComponentModel.PropertyDescriptor" />
<altmember cref="T:System.ComponentModel.AttributeCollection" />
<altmember cref="T:System.ComponentModel.PropertyDescriptorCollection" />
</Docs>
</Member>
<Member MemberName="No">
<MemberSignature Language="C#" Value="public static readonly System.ComponentModel.ReadOnlyAttribute No;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.ComponentModel.ReadOnlyAttribute No" />
<MemberSignature Language="DocId" Value="F:System.ComponentModel.ReadOnlyAttribute.No" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly No As ReadOnlyAttribute " />
<MemberSignature Language="F#" Value=" staticval mutable No : System.ComponentModel.ReadOnlyAttribute" Usage="System.ComponentModel.ReadOnlyAttribute.No" />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::ComponentModel::ReadOnlyAttribute ^ No;" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Primitives</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.ComponentModel.ReadOnlyAttribute</ReturnType>
</ReturnValue>
<Docs>
<summary>Specifies that the property this attribute is bound to is read/write and can be modified. This <see langword="static" /> field is read-only.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This field is the default setting for this attribute.
When you mark a property with the <xref:System.ComponentModel.ReadOnlyAttribute> set to `false`, the value of this attribute is set to the constant member <xref:System.ComponentModel.ReadOnlyAttribute.No>. Therefore, when you want to check whether the attribute is set to this value in your code, you must specify the attribute as <xref:System.ComponentModel.ReadOnlyAttribute.No?displayProperty=nameWithType>.
]]></format>
</remarks>
<altmember cref="T:System.ComponentModel.ReadOnlyAttribute" />
<altmember cref="F:System.ComponentModel.ReadOnlyAttribute.Yes" />
</Docs>
</Member>
<Member MemberName="Yes">
<MemberSignature Language="C#" Value="public static readonly System.ComponentModel.ReadOnlyAttribute Yes;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.ComponentModel.ReadOnlyAttribute Yes" />
<MemberSignature Language="DocId" Value="F:System.ComponentModel.ReadOnlyAttribute.Yes" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly Yes As ReadOnlyAttribute " />
<MemberSignature Language="F#" Value=" staticval mutable Yes : System.ComponentModel.ReadOnlyAttribute" Usage="System.ComponentModel.ReadOnlyAttribute.Yes" />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::ComponentModel::ReadOnlyAttribute ^ Yes;" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Primitives</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.ComponentModel.ReadOnlyAttribute</ReturnType>
</ReturnValue>
<Docs>
<summary>Specifies that the property this attribute is bound to is read-only and cannot be modified in the server explorer. This <see langword="static" /> field is read-only.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When you mark a property with the <xref:System.ComponentModel.ReadOnlyAttribute> set to `true`, the value of this attribute is set to the constant member <xref:System.ComponentModel.ReadOnlyAttribute.Yes>. Therefore, when you want to check whether the attribute is set to this value in your code, you must specify the attribute as <xref:System.ComponentModel.ReadOnlyAttribute.Yes?displayProperty=nameWithType>.
]]></format>
</remarks>
<altmember cref="T:System.ComponentModel.ReadOnlyAttribute" />
<altmember cref="F:System.ComponentModel.ReadOnlyAttribute.No" />
</Docs>
</Member>
</Members>
</Type>