static void RemoveInstance(ContextType type) { lock (typeof (Context)) { if (instances.ContainsKey (type)) { instances.Remove (type); } } }