public void Clear() { if (ResourceRemoved != null) { ResourceRemoveEventArgs m = new ResourceRemoveEventArgs(-1); foreach (System.EventHandler <ResourceRemoveEventArgs> e in ResourceRemoved?.GetInvocationList()) { e.BeginInvoke(this, m, e.EndInvoke, null); } } objectIdToResourceMap.Clear(); }
public void Clear() { if (ResourceRemoved != null) { ResourceRemoveEventArgs m = new ResourceRemoveEventArgs(-1); foreach (System.EventHandler <ResourceRemoveEventArgs> e in ResourceRemoved?.GetInvocationList()) { Task.Run(() => e.Invoke(this, m)); } } objectIdToResourceMap.Clear(); }
public void RemoveResource(int objectId) { if (objectIdToResourceMap.ContainsKey(objectId)) { objectIdToResourceMap.Remove(objectId); if (ResourceRemoved != null) { ResourceRemoveEventArgs m = new ResourceRemoveEventArgs(objectId); foreach (System.EventHandler <ResourceRemoveEventArgs> e in ResourceRemoved?.GetInvocationList()) { e.BeginInvoke(this, m, e.EndInvoke, null); } } } }