Пример #1
0
        public void AssignmentMustWorkForRec15()
        {
            var t   = _.t(new B0(), new B1(), new B2(), new B3(), new B4(), new B5(), new B6(), new B7(), new B8(), new B9(), new B10(), new B11(), new B12(), new B13(), new B14());
            A0  a0  = t._1;
            A1  a1  = t._2;
            A2  a2  = t._3;
            A3  a3  = t._4;
            A4  a4  = t._5;
            A5  a5  = t._6;
            A6  a6  = t._7;
            A7  a7  = t._8;
            A8  a8  = t._9;
            A9  a9  = t._10;
            A10 a10 = t._11;
            A11 a11 = t._12;
            A12 a12 = t._13;
            A13 a13 = t._14;
            A14 a14 = t._15;

            Assert.NotNull(a0);
            Assert.NotNull(a1);
            Assert.NotNull(a2);
            Assert.NotNull(a3);
            Assert.NotNull(a4);
            Assert.NotNull(a5);
            Assert.NotNull(a6);
            Assert.NotNull(a7);
            Assert.NotNull(a8);
            Assert.NotNull(a9);
            Assert.NotNull(a10);
            Assert.NotNull(a11);
            Assert.NotNull(a12);
            Assert.NotNull(a13);
            Assert.NotNull(a14);
        }
Пример #2
0
    public void setRespFalse()
    {
        A1.SetActive(false);
        A2.SetActive(false);
        A3.SetActive(false);
        A4.SetActive(false);
        A5.SetActive(false);
        A6.SetActive(false);
        A7.SetActive(false);

        B1.SetActive(false);
        B2.SetActive(false);
        B3.SetActive(false);
        B4.SetActive(false);
        B5.SetActive(false);
        B6.SetActive(false);
        B7.SetActive(false);

        C1.SetActive(false);
        C2.SetActive(false);
        C3.SetActive(false);
        C4.SetActive(false);
        C5.SetActive(false);
        C6.SetActive(false);
        C7.SetActive(false);
    }
Пример #3
0
        private static int K3MStep(int[,] map)
        {
            int pixelsThinned            = 0,
                mapWidth                 = map.GetLength(0),
                mapHeight                = map.GetLength(1);
            List <(int x, int y)> border = new List <(int x, int y)>();

            for (int x = 0; x < mapWidth; x++)
            {
                for (int y = 0; y < mapHeight; y++)
                {
                    if (A0.Contains(PixelWeight(map, x, y)))
                    {
                        border.Add((x, y));
                    }
                }
            }
            foreach (var(x, y) in border)
            {
                if (map[x, y] != 0 && A1.Contains(PixelWeight(map, x, y)))
                {
                    map[x, y] = 0;
                    pixelsThinned++;
                }
            }
            foreach (var(x, y) in border)
            {
                if (map[x, y] != 0 && A2.Contains(PixelWeight(map, x, y)))
                {
                    map[x, y] = 0;
                    pixelsThinned++;
                }
            }
            foreach (var(x, y) in border)
            {
                if (map[x, y] != 0 && A3.Contains(PixelWeight(map, x, y)))
                {
                    map[x, y] = 0;
                    pixelsThinned++;
                }
            }
            foreach (var(x, y) in border)
            {
                if (map[x, y] != 0 && A4.Contains(PixelWeight(map, x, y)))
                {
                    map[x, y] = 0;
                    pixelsThinned++;
                }
            }
            foreach (var(x, y) in border)
            {
                if (map[x, y] != 0 && A5.Contains(PixelWeight(map, x, y)))
                {
                    map[x, y] = 0;
                    pixelsThinned++;
                }
            }

            return(pixelsThinned);
        }
Пример #4
0
 public B(A1 a1, A2 a2, A3 a3, A4 a4)
 {
     Ma1 = a1;
     Ma2 = a2;
     Ma3 = a3;
     Ma4 = a4;
 }
Пример #5
0
        //////////////////////////Agregar modificar eliminar Informacion
        public void agregar()
        {
            if (A1.Text == "" || A2.Text == "" || A3.Text == "" || A4.Text == "")
            {
                MessageBox.Show("deben de tener todos los campos llenos");
            }
            else
            {
                conexion.Open();
                id        = Convert.ToInt32(A1.Text);
                nombre    = A2.Text;
                localidad = A3.Text;
                iata      = Convert.ToInt32(A4.Text);
                Insertar(id, nombre, localidad, iata);

                dataSet.Clear();
                dataGridView1.DataSource = dataSet.Tables[0];

                Query = "SELECT * FROM aeropuertos;";
                NpgsqlDataAdapter add = new NpgsqlDataAdapter(Query, conexion);
                add.Fill(dataSet);
                dataGridView1.DataSource = dataSet.Tables[0];

                A2.Clear();
                A3.Clear();
                A4.Clear();
                A1.Clear();
                conexion.Close();
            }
        }
 public void Test4()
 {
     A4 a = new A4();
     B4 b = new B4();
     Context.objMan.GetMapper<B4, A4>().Map(b, a);
     Assert.AreEqual(a.str, "string");
 }
        private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
        {
            try
            {
                kelimeEkleText.Focus();
                soldanSagaSorular.BorderStyle       = BorderStyle.None;
                yukaridanAsagiyaSorular.BorderStyle = BorderStyle.None;

                MemoryStream ms    = new MemoryStream();
                Bitmap       resim = new Bitmap(A4.Width, A4.Height);
                A4.DrawToBitmap(resim, new System.Drawing.Rectangle(0, 0, A4.Width, A4.Height));
                System.Drawing.Rectangle m = e.MarginBounds;


                soldanSagaSorular.BorderStyle       = BorderStyle.FixedSingle;
                yukaridanAsagiyaSorular.BorderStyle = BorderStyle.FixedSingle;

                if ((double)resim.Width / (double)resim.Height > (double)m.Width / (double)m.Height) // image is wider
                {
                    m.Height = (int)((double)resim.Height / (double)resim.Width * (double)m.Width);
                }
                else
                {
                    m.Width = (int)((double)resim.Width / (double)resim.Height * (double)m.Height);
                }
                e.Graphics.DrawImage(resim, m);
            }
            catch (Exception)
            {
            }
        }
Пример #8
0
        public void Test4()
        {
            A4 a = new A4();
            B4 b = new B4();

            Context.objMan.GetMapper <B4, A4>().Map(b, a);
            Assert.Equal("string", a.str);
        }
Пример #9
0
    public void Test4()
    {
        var a = new A4();
        var b = new B4();

        Context.ObjMan.GetMapper <B4, A4>().Map(b, a);
        a.Str.ShouldBe("string");
    }
Пример #10
0
        private ICollection <A1> GetAuthTree(ICollection <AuthSummaryAll> authSummaryAll)
        {
            ICollection <A1> a1s = new List <A1>();
            var a1Ids            = authSummaryAll.Select(a => a._1Id).Distinct().ToList();

            foreach (var a1Id in a1Ids)
            {
                var a1First = authSummaryAll.First(a => a._1Id == a1Id);
                var a1      = new A1();
                a1.Id    = a1First._1Id;
                a1.Title = a1First._1Title;
                ICollection <A2> a2s = new List <A2>();
                var a2Ids            = authSummaryAll.Where(a => a._1Id == a1Id).Select(a => a._2Id).Distinct().ToList();
                foreach (var a2Id in a2Ids)
                {
                    var a2First = authSummaryAll.First(a => a._2Id == a2Id);
                    var a2      = new A2();
                    a2.Id        = a2First._2Id;
                    a2.Title     = a2First._2Title;
                    a2.IconClass = a2First.IconClass;
                    ICollection <A3> a3s = new List <A3>();
                    var a3Ids            = authSummaryAll
                                           .Where(a => a._1Id == a1Id && a._2Id == a2Id).Select(a => a._3Id).Distinct().ToList();
                    foreach (var a3Id in a3Ids)
                    {
                        var a3First = authSummaryAll.First(a => a._3Id == a3Id);
                        var a3      = new A3();
                        a3.Id         = a3First._3Id;
                        a3.Title      = a3First._3Title;
                        a3.PreRoute   = a3First.PreRoute;
                        a3.Controller = a3First.Controller;
                        a3.Action     = a3First.Action;
                        a3.Parameters = a3.Parameters;
                        ICollection <A4> a4s = new List <A4>();
                        var a4Ids            = authSummaryAll
                                               .Where(a => a._1Id == a1Id && a._2Id == a2Id && a._3Id == a3Id).Select(a => a._4Id).Distinct().ToList();
                        foreach (var a4Id in a4Ids)
                        {
                            var a4First = authSummaryAll.First(a => a._4Id == a4Id);
                            var a4      = new A4();
                            a4.Id         = a4First._4Id;
                            a4.Title      = a4First._4Title;
                            a4.ClaimValue = a4First.ClaimValue;
                            a4.IsSelected = a4First.IsSelected;
                            a4s.Add(a4);
                        }
                        a3.A4s = a4s;
                        a3s.Add(a3);
                    }
                    a2.A3s = a3s;
                    a2s.Add(a2);
                }
                a1.A2s = a2s;
                a1s.Add(a1);
            }
            return(a1s);
        }
Пример #11
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            A4 a4 = await db.A4.FindAsync(id);

            db.A4.Remove(a4);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Пример #12
0
 public LoadProfilePU()
 {
     ip  = AbreXLSCurvaDeCargaNormalizada(1, "IP");
     gd  = AbreXLSCurvaDeCargaNormalizada(1, "GD");
     res = new Res();
     com = new Com();
     ind = new Ind();
     rur = new Rur();
     a4  = new A4();
 }
Пример #13
0
 void OnTriggerEnter(Collider other)
 {
     A2.SetActive(true);
     A3.SetActive(true);
     A4.SetActive(true);
     player.GetComponent <PlayerMove1>().enabled   = false;
     player.GetComponent <CrossHair>().enabled     = false;
     player.GetComponent <Rigidbody>().velocity    = new Vector3(0, 0, 0);
     camera1.GetComponent <Level1Camera>().enabled = true;
     gameObject.SetActive(false);
 }
Пример #14
0
        public void Struct_to_NullableStruct()
        {
            NullableTypes.B4.BInt bint = new B4.BInt();
            bint.fld1 = "b";
            B4 b = new B4();

            b.fld1 = bint;
            A4 a = Context.objMan.GetMapper <B4, A4>().Map(b);

            Assert.AreEqual("b", a.fld1.fld1);
        }
Пример #15
0
        public void Struct_to_NullableStruct()
        {
            NullableTypes.B4.BInt bint = new B4.BInt();
            bint.fld1 = "b";
            B4 b = new B4();

            b.fld1 = bint;
            A4 a = Mapper.Map <B4, A4>(b);

            Assert.AreEqual("b", a.fld1.fld1);
        }
Пример #16
0
        public void TestOrderMultipleRunAfter()
        {
            var a = new A4();
            var b = new B4();
            var c = new C4();
            var s = new IBuildStep[] { b, a, c };

            var sorted = Builder.SortSteps(s);

            Assert.That(sorted, Is.EqualTo(new IBuildStep[] { a, b, c }));
        }
Пример #17
0
    public void Test_StructProperties()
    {
        var a      = new A4();
        var b      = new B4();
        var mapper = Context.ObjMan.GetMapper <B4, A4>();

        // DynamicAssemblyManager.SaveAssembly();
        a = mapper.Map(b, a);
        b.Fld1.Fld1.ToString().ShouldBe(a.Fld1.Fld1);
        b.Fld2.Fld1.ToString().ShouldBe(a.Fld2.Fld1);
        b.Fld3.Fld1.ToString().ShouldBe(a.Fld3.Fld1);
    }
Пример #18
0
        public void Test_StructProperties()
        {
            A4 a = new A4();
            B4 b = new B4();
            var mapper = Context.objMan.GetMapper<B4, A4>();
            //DynamicAssemblyManager.SaveAssembly();

            a = mapper.Map(b, a);
            Assert.AreEqual(b.fld1.fld1.ToString(), a.fld1.fld1);
            Assert.AreEqual(b.fld2.fld1.ToString(), a.fld2.fld1);
            Assert.AreEqual(b.fld3.fld1.ToString(), a.fld3.fld1);
        }
 public void describe_AsFunc()
 {
     it["Func<TR>"]                 = () => TR.AsFunc()().Should().Be(TR);
     it["Func<T1, TR>"]             = () => A1.AsFunc(TR)(T).Should().Be(TR);
     it["Func<T1, TR>"]             = () => ((Action)(() => A1Throw.AsFunc(TR)(T))).ShouldThrow();
     it["Func<T1, T2, TR>"]         = () => A2.AsFunc(TR)(T, T1).Should().Be(TR);
     it["Func<T1, T2, TR>"]         = () => ((Action)(() => A2Throw.AsFunc(TR)(T, T1))).ShouldThrow();
     it["Func<T1, T2, T3, TR>"]     = () => A3.AsFunc(TR)(T, T1, T2).Should().Be(TR);
     it["Func<T1, T2, T3, TR>"]     = () => ((Action)(() => A3Throw.AsFunc(TR)(T, T1, T2))).ShouldThrow();
     it["Func<T1, T2, T3, T4, TR>"] = () => A4.AsFunc(TR)(T, T1, T2, T3).Should().Be(TR);
     it["Func<T1, T2, T3, T4, TR>"] = () => ((Action)(() => A4Throw.AsFunc(TR)(T, T1, T2, T3))).ShouldThrow();
 }
Пример #20
0
        public void Test_StructProperties()
        {
            A4  a      = new A4();
            B4  b      = new B4();
            var mapper = Context.objMan.GetMapper <B4, A4>();

            //DynamicAssemblyManager.SaveAssembly();

            a = mapper.Map(b, a);
            Assert.AreEqual(b.fld1.fld1.ToString(), a.fld1.fld1);
            Assert.AreEqual(b.fld2.fld1.ToString(), a.fld2.fld1);
            Assert.AreEqual(b.fld3.fld1.ToString(), a.fld3.fld1);
        }
Пример #21
0
        public void AssignmentMustWorkForRec23()
        {
            var t   = _.t(new B0(), new B1(), new B2(), new B3(), new B4(), new B5(), new B6(), new B7(), new B8(), new B9(), new B10(), new B11(), new B12(), new B13(), new B14(), new B15(), new B16(), new B17(), new B18(), new B19(), new B20(), new B21(), new B22());
            A0  a0  = t._1;
            A1  a1  = t._2;
            A2  a2  = t._3;
            A3  a3  = t._4;
            A4  a4  = t._5;
            A5  a5  = t._6;
            A6  a6  = t._7;
            A7  a7  = t._8;
            A8  a8  = t._9;
            A9  a9  = t._10;
            A10 a10 = t._11;
            A11 a11 = t._12;
            A12 a12 = t._13;
            A13 a13 = t._14;
            A14 a14 = t._15;
            A15 a15 = t._16;
            A16 a16 = t._17;
            A17 a17 = t._18;
            A18 a18 = t._19;
            A19 a19 = t._20;
            A20 a20 = t._21;
            A21 a21 = t._22;
            A22 a22 = t._23;

            Assert.NotNull(a0);
            Assert.NotNull(a1);
            Assert.NotNull(a2);
            Assert.NotNull(a3);
            Assert.NotNull(a4);
            Assert.NotNull(a5);
            Assert.NotNull(a6);
            Assert.NotNull(a7);
            Assert.NotNull(a8);
            Assert.NotNull(a9);
            Assert.NotNull(a10);
            Assert.NotNull(a11);
            Assert.NotNull(a12);
            Assert.NotNull(a13);
            Assert.NotNull(a14);
            Assert.NotNull(a15);
            Assert.NotNull(a16);
            Assert.NotNull(a17);
            Assert.NotNull(a18);
            Assert.NotNull(a19);
            Assert.NotNull(a20);
            Assert.NotNull(a21);
            Assert.NotNull(a22);
        }
Пример #22
0
 static void Main()
 {
     A1.Foo();
     A2.Foo();
     A3.Foo();
     A4.Foo();
     A5.Foo();
     A6.Foo();
     A7.Foo();
     A8.Foo();
     A9.Foo();
     A10.Foo();
     Console.WriteLine("<%END%>");
 }
Пример #23
0
    public void Initiation()
    {
        Agents = new AgentNav[4];

        Agents[3] = A5.GetComponent <AgentNav>();
        Agents[2] = A4.GetComponent <AgentNav>();
        Agents[1] = A3.GetComponent <AgentNav>();
        Agents[0] = A2.GetComponent <AgentNav>();

        foreach (AgentNav agent in Agents)
        {
            agent.Initiate();
        }
    }
Пример #24
0
        public void AssignmentMustWorkForRec5()
        {
            var t  = _.t(new B0(), new B1(), new B2(), new B3(), new B4());
            A0  a0 = t._1;
            A1  a1 = t._2;
            A2  a2 = t._3;
            A3  a3 = t._4;
            A4  a4 = t._5;

            Assert.NotNull(a0);
            Assert.NotNull(a1);
            Assert.NotNull(a2);
            Assert.NotNull(a3);
            Assert.NotNull(a4);
        }
Пример #25
0
    void Run(I <int> i)
    {
        // Viable callables: {A1,A4,A5}.M()
        i.M <int>();

        i = new A3();
        // Viable callables: A1.M()
        i.M <bool>();

        i = new A4();
        // Viable callables: A4.M()
        i.M <string>();

        i = ViableCallable.Mock <A4>();
        // Viable callables: {A4,A5}.M()
        i.M <string>();
    }
Пример #26
0
        public void SendPacket()
        {
            int checksum = 0;

            if (PacketNum++ > 999)
            {
                PacketNum = 0;
            }

            //get all the data in string form
            String num    = PacketNum.ToString("D3");
            String A0val  = A0.ReadRaw().ToString("D4");
            String A1val  = A1.ReadRaw().ToString("D4");
            String A2val  = A2.ReadRaw().ToString("D4");
            String A3val  = A3.ReadRaw().ToString("D4");
            String A4val  = A4.ReadRaw().ToString("D4");
            String A5val  = A5.ReadRaw().ToString("D4");
            char   D0val  = D0.Read() ? '1' : '0';
            char   D1val  = D1.Read() ? '1' : '0';
            char   D2val  = D2.Read() ? '1' : '0';
            char   D3val  = D3.Read() ? '1' : '0';
            char   D4val  = D4.Read() ? '1' : '0';
            char   D5val  = D5.Read() ? '1' : '0';
            char   D6val  = D6.Read() ? '1' : '0';
            char   D7val  = D7.Read() ? '1' : '0';
            char   Btnval = Btn.Read() ? '1' : '0';

            //concat the data
            String packet = num + A0val + A1val + A2val + A3val + A4val + A5val + Btnval + D0val + D1val + D2val + D3val + D4val + D5val + D6val + D7val;

            //compute checksum
            foreach (char digit in packet)
            {
                checksum += (digit);
            }
            checksum %= 1000;

            //append checksum and protocol frame stuff
            packet = "###" + packet + checksum + "\r\n";

            //convert to byte array for sending
            byte[] bytepacket = System.Text.Encoding.UTF8.GetBytes(packet);

            //send the packet
            _serial.Write(bytepacket, 0, bytepacket.Length);
        }
Пример #27
0
        public async Task <ActionResult> Create([Bind(Include = "Id,LeaderId,ConcertId")] A4 a4)
        {
            if (ModelState.IsValid)
            {
                db.A4.Add(a4);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.LeaderId  = new SelectList(db.Tracks, "Id", "Fullname");
            ViewBag.ConcertId = new SelectList(db.Concerts, "Id", "Date");
            if (Request.IsAjaxRequest())
            {
                return(PartialView(a4));
            }
            return(View(a4));
        }
Пример #28
0
        // GET: A4/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            A4 a4 = await db.A4.FindAsync(id);

            if (a4 == null)
            {
                return(HttpNotFound());
            }
            if (Request.IsAjaxRequest())
            {
                return(PartialView(a4));
            }
            return(View(a4));
        }
Пример #29
0
        public Aeropuertos()
        {
            InitializeComponent();
            string servidor  = "localhost";
            int    puerto    = 5432;
            string usuario   = "postgres";
            int    clave     = 123;
            string baseDatos = "proyectgb";


            cadenaConexion = "Server=" + servidor + "; " + "Port=" + puerto + "; " + "User Id=" + usuario + "; " + "Password="******"; " + "Database=" + baseDatos;
            conexion       = new NpgsqlConnection(cadenaConexion);
            Console.WriteLine(cadenaConexion);


            try
            {
                conexion.Open();
            }
            catch (Exception E)
            {
            }



            Query = "SELECT * FROM aeropuertos; ";
            NpgsqlDataAdapter add = new NpgsqlDataAdapter(Query, conexion);

            add.Fill(dataSet);
            dataGridView1.DataSource = dataSet.Tables[0];
            dataGridView2.DataSource = dataSet.Tables[0];
            dataGridView3.DataSource = dataSet.Tables[0];
            A1.Clear();
            A2.Clear();
            A3.Clear();
            A4.Clear();
            M1.Clear();
            M2.Clear();
            M3.Clear();
            M4.Clear();
            conexion.Close();
            Insertar(id, nombre, localidad, iata);
        }
Пример #30
0
 public static void Foo()
 {
     if (foo_called)
     {
         return;
     }
     foo_called = true;
     Console.WriteLine("A3.Foo");
     X.N++;
     A1.Foo();
     A2.Foo();
     A4.Foo();
     A5.Foo();
     A6.Foo();
     A7.Foo();
     A8.Foo();
     A9.Foo();
     A10.Foo();
 }
Пример #31
0
        private void dataGridView3_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            conexion.Open();
            DataGridViewRow fila = dataGridView1.CurrentRow;

            id = Convert.ToInt32(fila.Cells[0].Value);
            eliminarR(id);

            dataSet.Clear();
            dataGridView1.DataSource = dataSet.Tables[0];

            Query = "SELECT * FROM aeropuertos;";
            NpgsqlDataAdapter add = new NpgsqlDataAdapter(Query, conexion);

            add.Fill(dataSet);
            dataGridView1.DataSource = dataSet.Tables[0];
            A2.Clear();
            A3.Clear();
            A4.Clear();
            conexion.Close();
        }
Пример #32
0
        public void AssignmentMustWorkForRec8()
        {
            var t  = _.t(new B0(), new B1(), new B2(), new B3(), new B4(), new B5(), new B6(), new B7());
            A0  a0 = t._1;
            A1  a1 = t._2;
            A2  a2 = t._3;
            A3  a3 = t._4;
            A4  a4 = t._5;
            A5  a5 = t._6;
            A6  a6 = t._7;
            A7  a7 = t._8;

            Assert.NotNull(a0);
            Assert.NotNull(a1);
            Assert.NotNull(a2);
            Assert.NotNull(a3);
            Assert.NotNull(a4);
            Assert.NotNull(a5);
            Assert.NotNull(a6);
            Assert.NotNull(a7);
        }
Пример #33
0
 public A3()
 {
     A4 = new A4();
 }
Пример #34
0
 public void Oct5()
 {
     A4 a1 = new A4();
     Assert.AreEqual("2386F26FC10000",Conversion.Oct(a1));
 }
Пример #35
0
        static void Main(string[] args)
        {
            //A1就是類別名稱,Happy就是類別的方法
            //就像是我們裝好電腦之後,就可以做開機的動作,new就是裝好這台電腦
            A1 _PC = new A1();
            //然後我們就是做開機動作,
            string _Happy=_PC.Happy();

            //-----------------------------------------------

            A2 _PC2 = new A2("龍魂GE60"); //可以在裝好電腦時,為他取名,這樣大家才會知道是哪台,當然建構式可以多個

            string _strPC2 = _PC2.Happy();

            //A3 方法重載
            A2 _PC3 = new A2();
            string _strPC3 = _PC3.Happy("自爽");

            //--------------------------------------------------

            //A4 屬性與修飾子
            A4 _PC4 = new A4();
            _PC4.ReStartNum = 5;
            Console.WriteLine(_PC4.ReStart());

            //A5 封裝,剛才都是在使用封裝的
            //假設現在A5是NB,他也一樣會有ReStart
            A5 _NB = new A5();
            _NB.ReStartNum = 5;
            Console.WriteLine(_NB.ReStart());

            //A9 介面
            //抽象類別可以給初一些成員的實現,抽象類別的抽象成員可被子類別部分實現
            //介面的成員需要實現類別完全實現,一個類別只能繼承一個抽象類別,但可以實現多個介面等
            //第一類別是對物件的抽象;抽象類別是對類別的抽象;介面是對行為的抽象
            //第二如果行為跨越不同類別的物件,可使用介面;對於一些相似的類別物件,用繼承抽象類別
            //舉例 貓 狗都是動物,所以它們去繼承動物這抽象類別
            //但悟空和超人都會飛,但是悟空會變身,神話的悟空也會變身,所以此時可以用介面來完成
            //第三,抽象類別是從子類別中發現了公共的東西,泛化出父類別,然後子類別繼承父類別
            //,而介面是根本不知子類別的存在,方法如何實現還不確認,預先定義
            //例如在寫程式時候,是先寫了貓類別後,在寫出狗類別,最後發現有相同類似的,就泛化出動物類別,
            //不可能只有貓類別時候就想到動物類別
            //而介面是一同思考,定義一些項目,但不知道會有什麼動物,要如何實現,能做的就是是先定義這些比賽項目的行為介面
            //抽象類別是自底而上抽象類別的,而介面則是自頂而下設定的
            //(從狗貓衍伸出動物)(從項目延伸出不知那些動物會來參加預先定義好項目)

            A9_Interface _A9 = new A9_Interface("測試介面");

            IA9_Interface _A9_2 = new A9_Interface("測試介面2");
            Console.WriteLine(_A9.ChangeThing("第一個"));
            Console.WriteLine(_A9_2.ChangeThing("第二個"));

            //A10 泛型
            IList<Animal> arrayAnimal = new List<Animal>();
            arrayAnimal.Add(new Cat_Extend("tt"));
            arrayAnimal.Add(new Dog_Extend("tt2"));
            arrayAnimal.Add(new Cat_Extend("tt3"));
            Console.WriteLine(arrayAnimal.Count.ToString());

            //A11 泛型

            cat_deleget _cat = new cat_deleget("T");
            mouse_deleget _mo1 = new mouse_deleget("Ja");
            mouse_deleget _mo2 = new mouse_deleget("Jb");

            //表示將Mouse的Run方法透過實體化委託給CatShoutEventHandler登記到Cat的事件CatShout當中,+=是為了加進去add_CatShout的意思
            _cat.CatShout += new cat_deleget.CatShoutEventHandler(_mo1.Run);
            _cat.CatShout += new cat_deleget.CatShoutEventHandler(_mo2.Run);
            _cat.Shout();

            cat_deleget2 _cat2 = new cat_deleget2("T");
            mouse_deleget2 _mo21 = new mouse_deleget2("Ja");
            mouse_deleget2 _mo22 = new mouse_deleget2("Jb");
            _cat2.CatShout += new cat_deleget2.CatShoutEventHandler(_mo21.Run);
            _cat2.CatShout += new cat_deleget2.CatShoutEventHandler(_mo22.Run);
            _cat2.Shout();

            //A12-yieldreturn
            yieldreturn _yield = new yieldreturn();
            var _return = _yield.returnACD();
            string _strreturn = "";
            foreach (var item in _return)
            {
                _strreturn += item;
            }
            Console.WriteLine(_strreturn);

            Console.Read();
        }