Example #1
0
 public void TestMethod1()
 {
     var myObject = new ReflectionTestSubject();
       var allproperties = myObject.GetType().GetRuntimeProperties();
       foreach (var info in allproperties)
       {
     if (ImplementsInterface(info, "IEnumerable"))
     {
       Debug.WriteLine("{0} implements IEnumerable", info.Name);
     }
     else
     {
       Debug.WriteLine("{0} does not implement IEnumerable", info.Name);
     }
       }
 }
Example #2
0
        public void TestMethod1()
        {
            var myObject      = new ReflectionTestSubject();
            var allproperties = myObject.GetType().GetRuntimeProperties();

            foreach (var info in allproperties)
            {
                if (ImplementsInterface(info, "IEnumerable"))
                {
                    Debug.WriteLine("{0} implements IEnumerable", info.Name);
                }
                else
                {
                    Debug.WriteLine("{0} does not implement IEnumerable", info.Name);
                }
            }
        }
Example #3
0
        public void TestSimpleSerialize()
        {
            var bla = new ReflectionTestSubject();

            bla.MyList.Add("hallo");
            bla.MyList.Add("hallo2");
            bla.MyList.Add("hallo3");

            bla.MyString = "hoi";

            var m = new MemoryStream();

            SilverlightSerializer.Serialize(bla, m);
            m.Seek(0, SeekOrigin.Begin);

            var bla2 = SilverlightSerializer.Deserialize(m) as ReflectionTestSubject;

            Assert.AreEqual(bla.MyString, bla2.MyString);
            Assert.AreEqual(bla.MyList.Count, bla2.MyList.Count);
        }
        public void TestSimpleSerialize()
        {
            var bla = new ReflectionTestSubject();
              bla.MyList.Add("hallo");
              bla.MyList.Add("hallo2");
              bla.MyList.Add("hallo3");

              bla.MyString = "hoi";

              var m = new MemoryStream();
              SilverlightSerializer.Serialize(bla, m);
              m.Seek(0, SeekOrigin.Begin);

              var bla2 = SilverlightSerializer.Deserialize(m) as ReflectionTestSubject;

              Assert.AreEqual(bla.MyString, bla2.MyString);
              Assert.AreEqual(bla.MyList.Count, bla2.MyList.Count);
        }