Beispiel #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            WristWatch = await _context.WristWatch
                         .Include(w => w.Manufacturer).FirstOrDefaultAsync(m => m.Id == id);

            if (WristWatch == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Beispiel #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            WristWatch = await _context.WristWatch.FindAsync(id);

            if (WristWatch != null)
            {
                _context.WristWatch.Remove(WristWatch);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Beispiel #3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            WristWatch = await _context.WristWatch
                         .Include(w => w.Manufacturer).FirstOrDefaultAsync(m => m.Id == id);

            if (WristWatch == null)
            {
                return(NotFound());
            }
            ViewData["ManufacturerID"] = new SelectList(_context.Manufacturer, "ID", "Name");
            return(Page());
        }
Beispiel #4
0
        public static void Main(string[] args)
        {
            Timer         timer    = new Timer();
            DighitalWatch dighital = new DighitalWatch(timer);
            WristWatch    wrist    = new WristWatch(timer);

            int beginTime = DateTime.Now.Second;

            Console.WriteLine("Enter time on the timer(in seconds): ");

            if (!Int32.TryParse(Console.ReadLine(), out int timeOnTimer))
            {
                throw new Exception("Inccorect entered value");
            }

            for (int i = timeOnTimer; i > 0; i--)
            {
                Console.WriteLine("Time: " + i);

                Thread.Sleep(500);
            }

            timer.SimulateTimer(timeOnTimer, beginTime);
        }
		private static void AddBackpack( Mobile m )
		{
			Container pack = m.Backpack;

			if ( pack == null )
			{
				pack = new Backpack();
				pack.Movable = false;

				m.AddItem( pack );
			}

						
			PackItem( new RedBook( "a book", m.Name, 20, true ) );
			PackItem( new Gold( 1000 ) ); // Starting gold can be customized here
			PackItem( new Dagger() );
			PackItem( new AedilisLantern() );
			PackItem( new TrashPack() );
                        PackItem( new BankToken() );
			//PackItem( new WelcomeBook() );
			
			WristWatch SWW = new WristWatch();
			SWW.Name = "Time Keeper's Watch";
			SWW.Hue = 46;
			SWW.LootType = LootType.Blessed;
                        PackItem( SWW );

			//IDWand SID = new IDWand();
                        //SID.Charges = 10;
			//SID.Name = "Starter ID Wand";
			//SID.Identified = true;
                        //PackItem( SID );

			if (m.AccessLevel > AccessLevel.Player)
			PackItem( new StaffLantern() );

			if (m.AccessLevel > AccessLevel.Player)
			PackItem( new GMEthereal() );

			if (m.AccessLevel > AccessLevel.Player)
			PackItem( new GMHidingStone() );

			if (m.AccessLevel == AccessLevel.Counselor)
			PackItem( new CounselorRobe() );

			if (m.AccessLevel == AccessLevel.GameMaster)
			PackItem( new GMRobe() );

			if (m.AccessLevel == AccessLevel.Administrator)
			PackItem( new GMRobe() );

			if (m.AccessLevel == AccessLevel.Developer)
			PackItem( new DeveloperRobe() );

			if (m.AccessLevel == AccessLevel.Owner)
			PackItem( new OwnerRobe() );

			PlayerMobile pm = (PlayerMobile)m;
			pm.PopUpToggle = true;

		}
 private void OnEnable()
 {
     m_wristWatch = (WristWatch)target;
 }