/// <summary> /// Decrement activity count. When count equals 1, indicator will be inactivated. /// </summary> void IActivityManager.Detach() { lock (thisObject) { if (count == 1) { indicator.Inactivate(); } if (count > 0) { Interlocked.Decrement(ref count); } } }