public CardMenuHand() { this.MouseWheel += CardMenuMonster_MouseWheel; mi_1.IsEnabled = false; this.AddChild(mi_1); mi_1.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); mi_2.IsEnabled = false; this.AddChild(mi_2); mi_2.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); mi_3.IsEnabled = false; this.AddChild(mi_3); mi_3.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); this.AddChild(back2MainDeck); AllMenu.setMenuItemBind(back2MainDeck); back2MainDeck.Command = CardCommands.Back2MainDeck; this.AddChild(release2Graveyard); AllMenu.setMenuItemBind(release2Graveyard); release2Graveyard.Command = CardCommands.Release2Graveyard; this.AddChild(release2Banish); AllMenu.setMenuItemBind(release2Banish); release2Banish.Command = CardCommands.Release2Banish; mi_7.IsEnabled = false; this.AddChild(mi_7); mi_7.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); }
public CardMenuMagicTrap() { this.MouseWheel += CardMenuMonster_MouseWheel; mi_1.IsEnabled = false; this.AddChild(mi_1); mi_1.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); //this.AddChild(mi_2); //mi_2.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); //this.AddChild(mi_3); //mi_3.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); //this.AddChild(mi_4); //mi_4.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); //this.AddChild(mi_5); //mi_5.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); this.AddChild(set2FrontOrBack); AllMenu.setMenuItemBind(set2FrontOrBack); set2FrontOrBack.Command = CardCommands.Set2FrontOrBack; //this.AddChild(mi_6); //mi_6.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); //this.AddChild(mi_7); //mi_7.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); //this.mi_8.Items.Add(addSignBlue); //this.mi_8.Items.Add(addSignBlack); //this.mi_8.Items.Add(addSignRed); //this.mi_8.Items.Add(addSignGreen); //AllMenu.addSignMenuItems(mi_8); //this.AddChild(mi_8); this.AddChild(new Separator()); StackPanel sp = getSetSignItem(); this.AddChild(sp); this.AddChild(new Separator()); //this.mi_8.Items.Add(mi_10); //mi_10.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); //this.mi_8.Items.Add(mi_11); //mi_11.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); //this.mi_8.Items.Add(mi_12); //mi_12.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); //this.mi_8.Items.Add(mi_13); //mi_13.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); //this.AddChild(mi_8); //mi_8.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); AllMenu.setMenuItemBind(setCardRemark); setCardRemark.Command = CardCommands.SetCardRemark; this.AddChild(setCardRemark); }
public static StackPanel getSetSignItem() { MenuItem addSignBlue = new MenuItem { Header = "蓝" }; MenuItem addSignBlack = new MenuItem { Header = "黑" }; MenuItem addSignRed = new MenuItem { Header = "红" }; MenuItem addSignGreen = new MenuItem { Header = "绿" }; AllMenu.setMenuItemBind(addSignBlue); AllMenu.setMenuItemBind(addSignBlack); AllMenu.setMenuItemBind(addSignRed); AllMenu.setMenuItemBind(addSignGreen); addSignBlue.Command = CardCommands.AddBlueSign; addSignBlack.Command = CardCommands.AddBlackSign; addSignRed.Command = CardCommands.AddRedSign; addSignGreen.Command = CardCommands.AddGreenSign; ControlTemplate menuItemCT = Application.Current.TryFindResource("MyMenuItem") as ControlTemplate; addSignBlue.Width = addSignBlack.Width = addSignRed.Width = addSignGreen.Width = 25; addSignBlue.Template = addSignBlack.Template = addSignRed.Template = addSignGreen.Template = menuItemCT; TextBlock tb = new TextBlock(); tb.VerticalAlignment = VerticalAlignment.Center; tb.Text = "指示物:"; StackPanel sp = new StackPanel(); sp.Orientation = Orientation.Horizontal; sp.Children.Add(tb); sp.Children.Add(addSignBlue); sp.Children.Add(addSignBlack); sp.Children.Add(addSignRed); sp.Children.Add(addSignGreen); return(sp); }
public CardMenuMonster() { this.MouseWheel += CardMenuMonster_MouseWheel; this.AddChild(set2AtkOrDef); AllMenu.setMenuItemBind(set2AtkOrDef); set2AtkOrDef.Command = CardCommands.Set2AtkOrDef; this.AddChild(set2FrontOrBack); AllMenu.setMenuItemBind(set2FrontOrBack); set2FrontOrBack.Command = CardCommands.Set2FrontOrBack; this.AddChild(set2BackDef); AllMenu.setMenuItemBind(set2BackDef); set2BackDef.Command = CardCommands.Set2BackDef; this.AddChild(new Separator()); this.AddChild(activeCard); AllMenu.setMenuItemBind(activeCard); activeCard.Command = CardCommands.ActiveCard; this.AddChild(aim2Card); AllMenu.setMenuItemBind(aim2Card); aim2Card.Command = CardCommands.Aim2Card; this.AddChild(new Separator()); mi_4.IsEnabled = false; //this.AddChild(mi_4); mi_4.Click += new RoutedEventHandler(DuelEvent.MenuItem_Handle); this.AddChild(release2Graveyard); //release.Items.Add(release2Graveyard); AllMenu.setMenuItemBind(release2Graveyard); release2Graveyard.Command = CardCommands.Release2Graveyard; this.AddChild(release2Banish); //release.Items.Add(release2Banish); AllMenu.setMenuItemBind(release2Banish); release2Banish.Command = CardCommands.Release2Banish; //this.AddChild(release); this.AddChild(new Separator()); //this.AddChild(quecksetSign); //AllMenu.setMenuItemBind(quecksetSign); //quecksetSign.Command = CardCommands.AddBlueSign; //AllMenu.addSignMenuItems(setSign); //this.AddChild(setSign); StackPanel sp = getSetSignItem(); this.AddChild(sp); this.AddChild(new Separator()); AllMenu.setMenuItemBind(setCardRemark); setCardRemark.Command = CardCommands.SetCardRemark; this.AddChild(setCardRemark); }