コード例 #1
0
        public async Task <IActionResult> PutFifth([FromRoute] int id, [FromBody] Fifth fifth)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != fifth.FirstID)
            {
                return(BadRequest());
            }

            _context.Entry(fifth).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!FifthExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #2
0
        public async Task <IActionResult> PostFifth([FromBody] Fifth fifth)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.Fifths.Add(fifth);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (FifthExists(fifth.FirstID))
                {
                    return(new StatusCodeResult(StatusCodes.Status409Conflict));
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetFifth", new { id = fifth.FirstID }, fifth));
        }
コード例 #3
0
        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            Fifth fifth = new Fifth();

            this.Hide();
            fifth.Show();
        }
コード例 #4
0
 public Quintet(TFirst first, TSecond second, TThird third, TFourth fourth, TFifth fifth, string[] propertyNames)
     : base(first, second, third, fourth, propertyNames)
 {
     Fifth = fifth;
     Collection[UniqueIdentifier].Add(Fifth.ToString());
     KeyIndex = 4;
 }
コード例 #5
0
ファイル: EulerProblem060.cs プロジェクト: BobHemphill/Euler
 public bool IsFivePrimeTuple()
 {
     return             /*IsFourPrimeTuple() &&*/
            (Primes.IsPrimeInLine(Int64.Parse(First.ToString() + Fifth.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Second.ToString() + Fifth.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Third.ToString() + Fifth.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Fourth.ToString() + Fifth.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Fifth.ToString() + First.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Fifth.ToString() + Second.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Fifth.ToString() + Third.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Fifth.ToString() + Fourth.ToString())));
 }
コード例 #6
0
        public List <Scroll> ConvertToList()
        {
            List <Scroll> list = new List <Scroll>();

            list.AddRange(First.Where(_ => _.Number > 0).ToList());
            list.AddRange(Second.Where(_ => _.Number > 0).ToList());
            list.AddRange(Third.Where(_ => _.Number > 0).ToList());
            list.AddRange(Fourth.Where(_ => _.Number > 0).ToList());
            list.AddRange(Fifth.Where(_ => _.Number > 0).ToList());
            list.AddRange(Sixth.Where(_ => _.Number > 0).ToList());
            list.AddRange(Seventh.Where(_ => _.Number > 0).ToList());
            list.AddRange(Eigth.Where(_ => _.Number > 0).ToList());
            list.AddRange(Ninth.Where(_ => _.Number > 0).ToList());
            return(list);
        }
コード例 #7
0
	static int Main(string[] args)
	{
		FirstOuter.FirstInner.First V1 = new FirstOuter.FirstInner.First();
		FirstOuter.Second V2 = new FirstOuter.Second();
		FirstOuter.SecondInner.Third V3 = new FirstOuter.SecondInner.Third();
		FirstOuter.FirstInner.Fourth V4 = new FirstOuter.FirstInner.Fourth();
		Fifth V5 = new Fifth();
	
		Console.WriteLine("V1 is " + V1.MyIdentity);
		Console.WriteLine("V2 is " + V2.MyIdentity);
		Console.WriteLine("V3 is " + V3.MyIdentity);
		Console.WriteLine("V4 is " + V4.MyIdentity);
		Console.WriteLine("V5 is " + V5.MyIdentity);
		
		return 0;
	}
コード例 #8
0
    public static int Main(string[] args)
    {
        FirstOuter.FirstInner.First  V1 = new FirstOuter.FirstInner.First();
        FirstOuter.Second            V2 = new FirstOuter.Second();
        FirstOuter.SecondInner.Third V3 = new FirstOuter.SecondInner.Third();
        FirstOuter.FirstInner.Fourth V4 = new FirstOuter.FirstInner.Fourth();
        Fifth V5 = new Fifth();

        Console.WriteLine("V1 is " + V1.MyIdentity);
        Console.WriteLine("V2 is " + V2.MyIdentity);
        Console.WriteLine("V3 is " + V3.MyIdentity);
        Console.WriteLine("V4 is " + V4.MyIdentity);
        Console.WriteLine("V5 is " + V5.MyIdentity);

        return(0);
    }
コード例 #9
0
        public delegate void Fifth(string sayHi);                         //委托

        public void Do()
        {
            First first = new First(FirstMethod);

            first.Invoke();
            Second second = new Second(SecondMethod);

            second.Invoke("你好");
            Third  third   = new Third(ThirdMethod);
            int    tResult = third.Invoke();
            Fourth fourth  = new Fourth(FourthMethod);
            string outstr  = "";
            string refstr  = "";

            fourth.Invoke(out outstr, ref refstr);
            //把委托当做参数传递
            Fifth fifth = new Fifth(FifthMethod);

            SayHi("小安", fifth);
        }
コード例 #10
0
 public ScrollCase()
 {
     First.Add(new Scroll
     {
         Name   = "Disarm",
         Level  = 1,
         Incant = "Disarm your <target>",
         Type   = SpellType.EForce
     });
     First.Add(new Scroll
     {
         Name   = "Light",
         Level  = 1,
         Incant = "build a Light",
         Type   = SpellType.EForce
     });
     First.Add(new Scroll
     {
         Name   = "Lesser Investment",
         Level  = 3,
         Incant = "build a Lesser Investment",
         Type   = SpellType.EForce
     });
     First.Add(new Scroll
     {
         Name   = "Fortress",
         Level  = 1,
         Incant = "build a Fortress",
         Type   = SpellType.EForce
     });
     First.Add(new Scroll(1, SpellFlavor.Stone));
     First.Add(new Scroll(1, SpellFlavor.Lighting));
     First.Add(new Scroll(1, SpellFlavor.Ice));
     First.Add(new Scroll(1, SpellFlavor.Flame));
     Second.Add(new Scroll
     {
         Name   = "Weapon Shield",
         Level  = 2,
         Incant = "a Weapon Shield",
         Type   = SpellType.Protection
     });
     Second.Add(new Scroll
     {
         Name   = "Pin",
         Level  = 2,
         Incant = "Pin you",
         Type   = SpellType.Binding
     });
     Second.Add(new Scroll
     {
         Name   = "Repel",
         Level  = 2,
         Incant = "Repel you",
         Type   = SpellType.Binding
     });
     Second.Add(new Scroll
     {
         Name   = "Slow",
         Level  = 2,
         Incant = "Slow you",
         Type   = SpellType.Binding
     });
     Second.Add(new Scroll
     {
         Name   = "Mend Armor",
         Level  = 2,
         Incant = "Mend 10 Armor",
         Type   = SpellType.EForce
     });
     Second.Add(new Scroll(2, SpellFlavor.Stone));
     Second.Add(new Scroll(2, SpellFlavor.Lighting));
     Second.Add(new Scroll(2, SpellFlavor.Ice));
     Second.Add(new Scroll(2, SpellFlavor.Flame));
     Third.Add(new Scroll
     {
         Name   = "Bind",
         Level  = 3,
         Incant = "Bind you",
         Type   = SpellType.Binding
     });
     Third.Add(new Scroll
     {
         Name   = "Shatter",
         Level  = 3,
         Incant = "Shatter your <target>",
         Type   = SpellType.EForce
     });
     Third.Add(new Scroll
     {
         Name   = "Wall of Force",
         Level  = 3,
         Incant = "build a Wall of Force",
         Type   = SpellType.EForce
     });
     Third.Add(new Scroll
     {
         Name   = "Solidfy",
         Level  = 3,
         Incant = "Solidfy you",
         Type   = SpellType.EForce
     });
     Third.Add(new Scroll(3, SpellFlavor.Stone));
     Third.Add(new Scroll(3, SpellFlavor.Lighting));
     Third.Add(new Scroll(3, SpellFlavor.Ice));
     Third.Add(new Scroll(3, SpellFlavor.Flame));
     Fourth.Add(new Scroll
     {
         Name   = "Awaken",
         Level  = 4,
         Incant = "I Awaken you from commands",
         Type   = SpellType.Fixing
     });
     Fourth.Add(new Scroll
     {
         Name   = "Banish",
         Level  = 4,
         Incant = "Banish you",
         Type   = SpellType.EForce
     });
     Fourth.Add(new Scroll
     {
         Name   = "Enhanced Blade",
         Level  = 4,
         Incant = "an Enhanced Blade",
         Type   = SpellType.Protection
     });
     Fourth.Add(new Scroll
     {
         Name   = "Shun",
         Level  = 4,
         Incant = "Shun me",
         Type   = SpellType.Commands
     });
     Fourth.Add(new Scroll(4, SpellFlavor.Stone));
     Fourth.Add(new Scroll(4, SpellFlavor.Lighting));
     Fourth.Add(new Scroll(4, SpellFlavor.Ice));
     Fourth.Add(new Scroll(4, SpellFlavor.Flame));
     Fifth.Add(new Scroll
     {
         Name   = "Release",
         Level  = 5,
         Incant = "I Release you from binding",
         Type   = SpellType.Fixing
     });
     Fifth.Add(new Scroll
     {
         Name   = "Spell Shield",
         Level  = 5,
         Incant = "a Spell Shield",
         Type   = SpellType.Protection
     });
     Fifth.Add(new Scroll
     {
         Name   = "Subjugate",
         Level  = 5,
         Incant = "Subjugate you",
         Type   = SpellType.EForce
     });
     Fifth.Add(new Scroll
     {
         Name   = "Lesser Magic Storm",
         Level  = 5,
         Incant = "Lesser Magic Storm",
         Type   = SpellType.Evocation
     });
     Fifth.Add(new Scroll(5, SpellFlavor.Stone));
     Fifth.Add(new Scroll(5, SpellFlavor.Lighting));
     Fifth.Add(new Scroll(5, SpellFlavor.Ice));
     Fifth.Add(new Scroll(5, SpellFlavor.Flame));
     Sixth.Add(new Scroll
     {
         Name   = "Elemental Shield",
         Level  = 6,
         Incant = "an Elemental Shield",
         Type   = SpellType.Protection
     });
     Sixth.Add(new Scroll
     {
         Name   = "Sleep",
         Level  = 6,
         Incant = "Sleep",
         Type   = SpellType.Commands
     });
     Sixth.Add(new Scroll
     {
         Name   = "Wizard Lock",
         Level  = 6,
         Incant = "build a Wizard Lock",
         Type   = SpellType.EForce
     });
     Sixth.Add(new Scroll(6, SpellFlavor.Stone));
     Sixth.Add(new Scroll(6, SpellFlavor.Lighting));
     Sixth.Add(new Scroll(6, SpellFlavor.Ice));
     Sixth.Add(new Scroll(6, SpellFlavor.Flame));
     Seventh.Add(new Scroll
     {
         Name   = "Charm",
         Level  = 7,
         Incant = "be Charmed",
         Type   = SpellType.Commands
     });
     Seventh.Add(new Scroll
     {
         Name   = "Confine",
         Level  = 7,
         Incant = "Confine you",
         Type   = SpellType.Binding
     });
     Seventh.Add(new Scroll(7, SpellFlavor.Stone));
     Seventh.Add(new Scroll(7, SpellFlavor.Lighting));
     Seventh.Add(new Scroll(7, SpellFlavor.Ice));
     Seventh.Add(new Scroll(7, SpellFlavor.Flame));
     Eigth.Add(new Scroll
     {
         Name   = "Dispel",
         Level  = 8,
         Incant = "to Dispel",
         Type   = SpellType.Protection
     });
     Eigth.Add(new Scroll
     {
         Name   = "Reflect Magic",
         Level  = 8,
         Incant = "a Reflect Magic",
         Type   = SpellType.Protection
     });
     Eigth.Add(new Scroll
     {
         Name   = "Stun Limb",
         Level  = 8,
         Incant = "Stun your <limb>",
         Type   = SpellType.EForce
     });
     Eigth.Add(new Scroll(8, SpellFlavor.Stone));
     Eigth.Add(new Scroll(8, SpellFlavor.Lighting));
     Eigth.Add(new Scroll(8, SpellFlavor.Ice));
     Eigth.Add(new Scroll(8, SpellFlavor.Flame));
     Ninth.Add(new Scroll
     {
         Name   = "Circle of Power",
         Level  = 9,
         Incant = "build a Circle of Power",
         Type   = SpellType.EForce
     });
     Ninth.Add(new Scroll
     {
         Name   = "Magic Storm",
         Level  = 9,
         Incant = "Magic Storm",
         Type   = SpellType.Evocation
     });
     Ninth.Add(new Scroll
     {
         Name   = "Prison",
         Level  = 9,
         Incant = "build a Prison",
         Type   = SpellType.EForce
     });
     Ninth.Add(new Scroll
     {
         Name   = "Ward",
         Level  = 9,
         Incant = "build a Ward",
         Type   = SpellType.EForce
     });
     Ninth.Add(new Scroll(9, SpellFlavor.Stone));
     Ninth.Add(new Scroll(9, SpellFlavor.Lighting));
     Ninth.Add(new Scroll(9, SpellFlavor.Ice));
     Ninth.Add(new Scroll(9, SpellFlavor.Flame));
 }
コード例 #11
0
 public void SayHiTaowa(string name, Fifth fifth)
 {
     fifth.Invoke(name);
 }