public void ClearNodes() { lock (nameDictionary) { foreach (long oid in nameDictionary.Keys) { NameNode node = nameDictionary[oid]; window.RemoveChild(node.Widget); node.Dispose(); } nameDictionary.Clear(); } }
public void RemoveNode(long oid) { lock (nameDictionary) { if (!nameDictionary.ContainsKey(oid)) { return; } NameNode node = nameDictionary[oid]; window.RemoveChild(node.Widget); node.Dispose(); nameDictionary.Remove(oid); } }