void dialog_LostFocused(IFocusable sender, FocusEventArgs args) { var dialog = sender as UserMenuDialog; if (dialog.Selected) { sound.Play(PPDSetting.DefaultSounds[1], -1000); UserMenuDialog.Mode mode = dialog.SelectedMode; switch (mode) { case UserMenuDialog.Mode.ChangeLeader: ChangeLeader?.Invoke(this, EventArgs.Empty); break; case UserMenuDialog.Mode.Kick: KickUser?.Invoke(this, EventArgs.Empty); break; } } this.RemoveChild(dialog); }
void userSelectComponent_ChangeLeader(object sender, EventArgs e) { ChangeLeader?.Invoke(userSelectComponent.SelectedUser); }