Inheritance: MonoBehaviour
コード例 #1
0
        void onWin()
        {
            level += 1;
            lives += 1;
            score += 1000;

            if (level < 11)
            {
                for (int i = 0; i < 49; i++)
                {
                    blocks.Remove(blocks[0]);
                }
                LevelLoad(level);
                findStart();
            }
            else
            {
                //Change to the name screen
                Form  f  = this.FindForm();
                HowTo hs = new HowTo();
                f.Controls.Add(hs);
                hs.Location = new Point((f.Width - hs.Width) / 2, (f.Height - hs.Height) / 2);
                hs.Focus();
                f.Controls.Remove(this);
            }
        }
コード例 #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            HowTo = await _context.HowTos.FindAsync(id);

            if (HowTo != null)
            {
                var path = HowTo.File;

                _context.HowTos.Remove(HowTo);
                await _context.SaveChangesAsync();

                var rootFolder = _env.WebRootPath;
                if (System.IO.File.Exists(Path.Combine(rootFolder, path)))
                {
                    System.IO.File.Delete(Path.Combine(rootFolder, path));
                }
            }

            return(RedirectToPage("./Index"));
        }
コード例 #3
0
ファイル: KBController.cs プロジェクト: peter0chow/howtos
        public IHttpActionResult UpdateHowTo(HowTo howTo)
        {
            try
            {
                if (howTo.Id == 0)
                {
                    return(BadRequest("Du har inte angett vilket KB som du vill uppdatera!"));
                }

                else
                {
                    new Database().SqlUpdateHowTo(howTo);
                    return(Ok(new Database().SqlGetAllHowTos().Where(x => x.Id == howTo.Id).FirstOrDefault()));
                }
            }

            catch (Exception e)
            {
                string msg = "Object reference not set to an instance of an object.";

                if (e.Message == msg)
                {
                    return(BadRequest("Du har inte matat in något värde alls!"));
                }


                else
                {
                    return(Content(HttpStatusCode.Forbidden, "Error code: " + e.Message));
                }
            }
        }
コード例 #4
0
        private void AddRecipient(string email, HowTo howTo)
        {
            var recipient = new MapiRecipDesc {
                recipClass = (int)howTo, name = email
            };

            _mRecipients.Add(recipient);
        }
コード例 #5
0
        bool AddRecipient(string email, HowTo howTo)
        {
            MapiRecipDesc recipient = new MapiRecipDesc { recipClass = (int)howTo, name = email };

            m_recipients.Add(recipient);

            return true;
        }
コード例 #6
0
    bool AddRecipient(string email, HowTo howTo)
    {
        MapiRecipDesc recipient = new MapiRecipDesc();

        recipient.recipClass = (int)howTo;
        recipient.name       = email;
        m_recipients.Add(recipient);
        return(true);
    }
コード例 #7
0
ファイル: Email.cs プロジェクト: dreamskid/ZadGestion
        /// <summary>
        /// Add recipients to the email
        /// <param name="_Email">The email</param>
        /// <param name="_HowTo">Which type of recipient</param>
        /// <returns>True if the operation went well, false otherwise</returns>
        /// </summary>
        bool Add_Recipient(string _Email, HowTo _HowTo)
        {
            MapiRecipDesc recipient = new MapiRecipDesc();

            recipient.recipClass = (int)_HowTo;
            recipient.name       = _Email;
            m_Recipients.Add(recipient);

            return(true);
        }
コード例 #8
0
ファイル: Mailer.cs プロジェクト: kav-it/SharpLib
        private bool AddRecipient(String email, HowTo howTo)
        {
            MapiRecipDesc recipient = new MapiRecipDesc();

            recipient.RecipClass = (int)howTo;
            recipient.Name       = email;
            _recipients.Add(recipient);

            return(true);
        }
コード例 #9
0
ファイル: MenuScreen.cs プロジェクト: lorewolf686/JunglePath
        private void Play_Click(object sender, EventArgs e)
        {
            //Change to the how to play screen
            Form  f  = this.FindForm();
            HowTo hs = new HowTo();

            f.Controls.Add(hs);
            hs.Location = new Point((f.Width - hs.Width) / 2, (f.Height - hs.Height) / 2);
            hs.Focus();
            f.Controls.Remove(this);
        }
コード例 #10
0
ファイル: MAPIHelper.cs プロジェクト: jwickberg/libpalaso
		bool AddRecipient(string email, HowTo howTo)
		{
			MapiRecipDesc recipient = new MapiRecipDesc();

			recipient.recipClass = (int)howTo;
			recipient.name = email;
			// Note: For Outlook Express it would be better to also set recipient.address so that it
			// shows the email address in the confirmation dialog, but this messes up things in
			// Outlook and Windows Mail.
			m_recipients.Add(recipient);

			return true;
		}
コード例 #11
0
ファイル: MAPIHelper.cs プロジェクト: vkarthim/libpalaso
        bool AddRecipient(string email, HowTo howTo)
        {
            MapiRecipDesc recipient = new MapiRecipDesc();

            recipient.recipClass = (int)howTo;
            recipient.name       = email;
            // Note: For Outlook Express it would be better to also set recipient.address so that it
            // shows the email address in the confirmation dialog, but this messes up things in
            // Outlook and Windows Mail.
            m_recipients.Add(recipient);

            return(true);
        }
コード例 #12
0
        private CookingStrategy LoadStrategy(HowTo strat)
        {
            switch (strat)
            {
            case HowTo.Cook:
                return(new CookStrategy(this));

            case HowTo.Bake:
                return(new BakeStrategy(this));

            default:
                throw new NotSupportedException("I have no idea how to cook!");
            }
        }
コード例 #13
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            HowTo = await _context.HowTos.FirstOrDefaultAsync(m => m.Id == id);

            if (HowTo == null)
            {
                return(NotFound());
            }
            return(Page());
        }
コード例 #14
0
ファイル: KBController.cs プロジェクト: peter0chow/howtos
        public IHttpActionResult AddHowTo(HowTo howTo)
        {
            try
            {
                new Database().SqlAddHowTo(howTo);
                return(Ok(new Database().SqlGetAllHowTos().OrderByDescending(x => x.Created).FirstOrDefault()));
            }

            catch (Exception e)
            {
                string msg = "Object reference not set to an instance of an object.";

                if (e.Message == msg)
                {
                    return(BadRequest("Du har inte matat in något värde alls!"));
                }

                else
                {
                    return(Content(HttpStatusCode.Forbidden, "Error code: " + e.Message));
                }
            }
        }
コード例 #15
0
ファイル: Mailer.cs プロジェクト: kav-it/SharpLib
        private bool AddRecipient(String email, HowTo howTo)
        {
            MapiRecipDesc recipient = new MapiRecipDesc();

            recipient.RecipClass = (int)howTo;
            recipient.Name = email;
            _recipients.Add(recipient);

            return true;
        }
コード例 #16
0
        private bool AddRecipient(string email, HowTo howTo)
        {
            var recipient = new MapiRecipDesc();

            recipient.recipClass = (int) howTo;
            recipient.name = email;
            m_recipients.Add(recipient);

            return true;
        }
コード例 #17
0
ファイル: Perform.cs プロジェクト: paszczaczek/Nutadore
 public Perform(HowTo howTo, double left, double right)
 {
     this.howTo = howTo;
     this.left = left;
     this.right = right;
 }
コード例 #18
0
 public string MakeFavouriteDish(HowTo strat)
 {
     LoadStrategy(strat);
     return(_strategy.Cook());
 }