public HResult RemoveItem(int cookie)
{
try
{
NotificationItem wrapper;
if (!_itemMap.TryGetValue(cookie, out wrapper))
return HResult.False;
_itemMap.Remove(cookie);
_items.Remove(wrapper);
UpdateButton();
if (_window != null)
_window.RedrawItems(_items);
return HResult.OK;
}
catch (Exception ex)
{
return ErrorUtil.GetHResult(ex);
}
}