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

ProvidesContextAttribute Class

Indicates the type member or parameter of some type, that should be used instead of all other ways to get the value of that type. This annotation is useful when you have some "context" value evaluated and stored somewhere, meaning that all other ways to get this value must be consolidated with existing one.

Namespace:  RingSoft.DbMaintenance
Assembly:  RingSoft.DbMaintenance (in RingSoft.DbMaintenance.dll)

Syntax


[AttributeUsageAttribute]
public sealed class ProvidesContextAttribute : Attribute
<AttributeUsageAttribute> _
Public NotInheritable Class ProvidesContextAttribute _
	Inherits Attribute
[AttributeUsageAttribute]
public ref class ProvidesContextAttribute sealed : public Attribute

Examples


C#
class Foo {
[ProvidesContext] IBarService _barService = ...;
void ProcessNode(INode node) {
DoSomething(node, node.GetGlobalServices().Bar);
//              ^ Warning: use value of '_barService' field
}
}

Inheritance Hierarchy


Object
  Attribute
    RingSoft.DbMaintenance..::..ProvidesContextAttribute