Posted by: Cirilo Meggiolaro | 02/15/2009

Tip of the day #124 – ContextStaticAttribute

The ContextStaticAttribute must be used for static members in a class when you don’t want those values to be shared by different contexts.

When one context changes the member value, the other context will not be affected by this change.

The syntax is pretty straightforward. As any other attribute, it’s just a matter of add it to the static member:

[ContextStaticAttribute]
static int b = 123;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: