예제 #1
0
        private void StartClicked(object sender, RoutedEventArgs e)
        {
            e.Handled = true;

            if (Player.All.Any(p => p.Groups.Any(x => x.Count > 0)))
            {
                if (MessageBoxResult.Yes ==
                    TopMostMessageBox.Show(
                        "Some players have cards currently loaded.\n\nReset the game before starting limited game?",
                        "Warning", MessageBoxButton.YesNo))
                {
                    Program.Client.Rpc.ResetReq();
                }
            }
            if (addCards.Visibility == Visibility.Visible)
            {
                if (addCards.SelectedIndex == 1)
                {
                    Program.Client.Rpc.AddPacksReq(Packs.Select(p => p.Id).ToArray(), false);
                }
                else if (addCards.SelectedIndex == 0)
                {
                    Program.Client.Rpc.AddPacksReq(Packs.Select(p => p.Id).ToArray(), true);
                }
            }
            else
            {
                Program.Client.Rpc.StartLimitedReq(Packs.Select(p => p.Id).ToArray());
            }
            Close();
            // Solves an issue where Dialog isn't the active window anymore if the confirmation dialog above was shown
            //fix MAINWINDOW bug
            WindowManager.PlayWindow.Activate();
        }
예제 #2
0
 public ProductEntity(Product Product, params object[] args) : base(Product)
 {
     foreach (object arg in args)
     {
         if (arg is Category Category)
         {
             CategoryEntity = new CategoryEntity(Category);
         }
         if (arg is Manufacturer Manufacturer)
         {
             ManufacturerEntity = new ManufacturerEntity(Manufacturer);
         }
         if (arg is ICollection <Discount> Discounts)
         {
             DiscountEntities = Discounts.Select(model => new DiscountEntity(model)).ToList();
         }
         if (arg is ICollection <Inventory> Inventories)
         {
             InventoryEntities = Inventories.Select(model => new InventoryEntity(model, model.WareHouse)).ToList();
         }
         if (arg is ICollection <IssueNoteLine> IssueNoteLines)
         {
             IssueNoteLineEntities = IssueNoteLines.Select(model => new IssueNoteLineEntity(model, model.IssueNote)).ToList();
         }
         if (arg is ICollection <Pack> Packs)
         {
             PackEntities = Packs.Select(model => new PackEntity(model)).ToList();
         }
         if (arg is ICollection <ProductPicture> ProductPictures)
         {
             ProductPictureEntities = ProductPictures.Select(model => new ProductPictureEntity(model)).ToList();
         }
         if (arg is ICollection <ProductValue> ProductValues)
         {
             ProductValueEntities = ProductValues.Select(model => new ProductValueEntity(model, model.Attribute, model.Language)).ToList();
         }
         if (arg is ICollection <ReceiptNoteLine> ReceiptNoteLines)
         {
             ReceiptNoteLineEntities = ReceiptNoteLines.Select(model => new ReceiptNoteLineEntity(model, model.ReceiptNote)).ToList();
         }
     }
 }