RingSoft.DbLookup.Controls.WPF.Properties Namespace
RingSoft.DbMaintenance Namespace

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.Properties
Assembly:  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


Using this attribute only makes sense if all collection methods are marked with this attribute.

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();
}
}

Inheritance Hierarchy


Object
  Attribute
    RingSoft.DbLookup.Controls.WPF.Properties..::..CollectionAccessAttribute