CollectionAccessAttribute Class
Indicates how method, constructor invocation, or property access
over collection type affects the contents of the collection.
Use CollectionAccessType to specify the access type.
Namespace:
RingSoft.DbLookup.Controls.WPF.PropertiesAssembly: RingSoft.DbLookup.Controls.WPF (in RingSoft.DbLookup.Controls.WPF.dll)
Syntax
[AttributeUsageAttribute] public sealed class CollectionAccessAttribute : Attribute
<AttributeUsageAttribute> _ Public NotInheritable Class CollectionAccessAttribute _ Inherits Attribute
[AttributeUsageAttribute] public ref class CollectionAccessAttribute sealed : public Attribute
Remarks
Examples
C#
public class MyStringCollection : List<string> { [CollectionAccess(CollectionAccessType.Read)] public string GetFirstString() { return this.ElementAt(0); } } class Test { public void Foo() { // Warning: Contents of the collection is never updated var col = new MyStringCollection(); string x = col.GetFirstString(); } }