RingSoft.DataEntryControls.Engine.Annotations Namespace
RingSoft.DataEntryControls.WPF 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.DataEntryControls.WPF
Assembly:  RingSoft.DataEntryControls.WPF (in RingSoft.DataEntryControls.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.DataEntryControls.WPF..::..CollectionAccessAttribute