private void UpdateHotbarButton(ref Button button, HotbarButton cfg) { button.Content = cfg.Text; if (String.IsNullOrWhiteSpace(cfg.Text)) { button.Visibility = Visibility.Hidden; } else { button.Visibility = Visibility.Visible; } }
private void Execute(HotbarButton button) { var path = button.Executable; if (string.IsNullOrWhiteSpace(path)) { return; } try { Process.Start(path); } catch (Exception e) { MessageBox.Show("Error executing " + path + ":\n" + e.Message); Globals.Logger.Log("Error executing " + path + ": " + e.Message, LogType.Error); } }