private void BtnTwitch_Click(object sender, RoutedEventArgs e) { // Tries to connect to the twitch service given the credentials in the settings or disconnects System.Windows.Controls.MenuItem item = (System.Windows.Controls.MenuItem)sender; if (item.Tag.ToString().Equals("Connect")) { // Connects TwitchHandler.BotConnect(); } else if (item.Tag.ToString().Equals("Disconnect")) { // Disconnects TwitchHandler.Client.Disconnect(); } }
private void Mi_Queue_Click(object sender, RoutedEventArgs e) { // Opens the Queue Window System.Windows.Controls.MenuItem item = (System.Windows.Controls.MenuItem)sender; if (item.Tag.ToString().Contains("Window")) { if (!IsWindowOpen <Window_Queue>()) { Window_Queue wQ = new Window_Queue { Top = Top, Left = Left }; wQ.Show(); } } // Opens the Queue in the Browser else if (item.Header.ToString().Contains("Browser")) { Process.Start("https://songify.rocks/queue.php?id=" + Settings.Uuid); } }
private void BtnHistory_Click(object sender, RoutedEventArgs e) { // Opens the History in either Window or Browser System.Windows.Controls.MenuItem item = (System.Windows.Controls.MenuItem)sender; if (item.Tag.ToString().Contains("Window")) { if (!IsWindowOpen <HistoryWindow>()) { // Opens the 'History'-Window HistoryWindow hW = new HistoryWindow { Top = Top, Left = Left }; hW.ShowDialog(); } } // Opens the Queue in the Browser else if (item.Tag.ToString().Contains("Browser")) { Process.Start("https://songify.rocks/history.php?id=" + Settings.Uuid); } }
private void InternalBuildMenu(ZeroMenu menu, ItemCollection items) { foreach (var item in menu) { var menuitem = new System.Windows.Controls.MenuItem(); menuitem.Header = item.Key; if (item.Value.Count > 0) InternalBuildMenu(item.Value, menuitem.Items); else { menuitem.Command = item.Value.MenuAction; //TODO: Esto hay que hacerlo algun dia! //menuitem.ContextMenu = new System.Windows.Controls.ContextMenu(); //menuitem.ContextMenu.Items.Add(new System.Windows.Controls.MenuItem {Header = "Anclar al Inicio", IsCheckable=true}); } items.Add(menuitem); } }