private void OnBaseVideoUnloaded() { ICollection keyCollection = dialogs.Keys; Type[] keys = new Type[keyCollection.Count]; keyCollection.CopyTo(keys, 0); for (int index = 0; index < keys.Length; index++) { Type type = keys[index]; BaseDialog dialog = dialogs[type] as BaseDialog; if (dialog.Scope == DialogScope.Video) { dialog.Destroy(); } } }
private void OnBaseDocumentUnloaded(Document document) { ICollection keyCollection = dialogs.Keys; Type[] keys = new Type[keyCollection.Count]; keyCollection.CopyTo(keys, 0); for (int index = 0; index < keys.Length; index++) { Type type = keys[index]; BaseDialog dialog = dialogs[type] as BaseDialog; if ((dialog.Scope == DialogScope.Singleton) || (dialog.Scope == DialogScope.Document)) { dialog.Destroy(); } } }