コード例 #1
0
        static internal void HardcodeAuctions()
        {
            AuctionItem p1 = new AuctionItem(1, "Brugt cykel", 1000.00M, 500.00M, "Daniel Alexander Nedergaard", 12345678, DateTime.Now);
            AuctionItem p2 = new AuctionItem(2, "Smart ny bil", 50000.00M, 75000.00M, "Bjørk", 87654321, DateTime.Now);

            AuctionHouseData.AddAuction(p1);
            AuctionHouseData.AddAuction(p2);
        }
コード例 #2
0
        internal static List <AuctionItem> GetAllAuctions()
        {
            if (AuctionList.Count == 0)
            {
                AuctionItem.HardcodeAuctions();
            }

            return(AuctionList);
        }
コード例 #3
0
        internal static AuctionItem GetAuction(int itemNumber)
        {
            if (AuctionList.Count == 0)
            {
                AuctionItem.HardcodeAuctions();
            }

            lock (myLock)
            {
                foreach (var item in AuctionList)
                {
                    if (item.ItemNumber == itemNumber)
                    {
                        return(item);
                    }
                }
            }

            return(null);
        }
コード例 #4
0
 internal static void AddAuction(AuctionItem p)
 {
     AuctionList.Add(p);
 }