public static void RemoveHandler(IDoubleActionProvider provider, DoubleActionEventHandler handler) { if (!map.ContainsKey(provider)) { return; } DoubleActionDispatcher dispatcher = map[provider]; dispatcher.DoubleActionEvent -= handler; if (dispatcher.DoubleActionEvent.GetInvocationList().Length == 0) { dispatcher.Release(); map.Remove(provider); } } }