示例#1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //Products.Add(new Product()
            //{;
            //    BandWide = String.Format("{0}00", number),
            //    Freq = String.Format("{0}000", number),
            //    Chk1 = false,
            //    Chk2 = false
            //});
            //number++;
            testProducts222.Add((Product2)viewmodel.testProduct2.Clone());
            viewmodel.testProduct2.BandWide = "9999";

            Product2 tmp2  = (Product2)testProducts222.Where(x => x.BandWide == "345").First();
            Product2 tmp21 = (Product2)tmp2.Clone();

            testProducts23.Add((Product2)tmp2.Clone());
            int  idx  = testProducts23.IndexOf(tmp2);
            int  idx1 = testProducts222.IndexOf(tmp2);
            bool b0   = tmp2.HasSameValues(tmp21);
            bool b1   = tmp2.Equals(tmp21);
            bool b3   = tmp2 == tmp21;

            //tmp2.BandWide = "33333";

            viewmodel.testProduct2.SetValues("BandWide", "10000000");

            testProducts222.Where(x => x.Freq == "1000").ToList().Clone();
        }
示例#2
0
        static void Main(string[] args)
        {
            var prod = new Product1("This is me");

            WriteLine(prod.Name);
            WriteLine((prod.Clone() as Product1).Name);

            var prod2 = new Product2("This is you");

            WriteLine(prod2.Title);
            WriteLine((prod2.Clone() as Product2).Title);
        }