예제 #1
0
 private void OnInstanceRemoved(object sender, InstanceRemovedEventArgs e)
 {
     _instanceRemoved?.Invoke(sender, e);
 }
예제 #2
0
        private void InstanceRemovedEventHandler(Object sender, InstanceRemovedEventArgs e)
        {
            // remove the menu item for the removed instance.
            trayIcon.ContextMenuStrip.Items.RemoveByKey(e.InstanceName);
            _mainFormInstances.Remove(e.InstanceName);

            // if we only have one instance left, reload everything so that the context
            // menu only shows the one instances' menu items.
            if (_mainFormInstances.Count == 1)
                LoadInstances();
        }