コード例 #1
0
        public static bool TryPick(MarketStateDbBase marketStateDB, out StallDTO stall)
        {
            var win = CreateWindow();
            var vm  = new StallPickerVM(marketStateDB, win);
            var res = win.ShowDialog();

            stall = vm.PickedStall;
            return(res == true && stall != null);
        }
コード例 #2
0
        public static StallDTO PickFirstVacant(MarketStateDbBase mkt)
        {
            var vm = new StallPickerVM(mkt, null);

            foreach (var sec in vm.Sections)
            {
                vm.PickedSection = sec;
                if (vm.Stalls.Any())
                {
                    return(vm.Stalls.First());
                }
            }
            throw No.Match <StallDTO>("state", "vacant");
        }