// Code to execute when the application is launching (eg, from Start) // This code will not execute when the application is reactivated private void Application_Launching(object sender, LaunchingEventArgs e) { var ser = new so11::MySerializer(); SO11895998.Foo foo = new SO11895998.Bar {Name = "abc", Value = 4}; var clone = (SO11895998.Bar) ser.DeepClone(foo); Debug.Assert(clone.Name == "abc"); Debug.Assert(clone.Value == 4); clone = (SO11895998.Bar)Serializer.DeepClone(foo); Debug.Assert(clone.Name == "abc"); Debug.Assert(clone.Value == 4); Execute(); //try //{ // var blob = Resource1.nwind_proto; // using (var ms = new MemoryStream(blob)) // { // var db = (DAL.DatabaseCompat)new MySerializer().Deserialize(ms, null, typeof(DAL.DatabaseCompat)); // int i = db.Orders.Count; // } //} //catch (Exception ex) //{ // Debug.WriteLine(ex.Message); //} }
// Code to execute when the application is launching (eg, from Start) // This code will not execute when the application is reactivated private void Application_Launching(object sender, LaunchingEventArgs e) { var ser = new so11::MySerializer(); SO11895998.Foo foo = new SO11895998.Bar { Name = "abc", Value = 4 }; var clone = (SO11895998.Bar)ser.DeepClone(foo); Debug.Assert(clone.Name == "abc"); Debug.Assert(clone.Value == 4); clone = (SO11895998.Bar)Serializer.DeepClone(foo); Debug.Assert(clone.Name == "abc"); Debug.Assert(clone.Value == 4); Execute(); //try //{ // var blob = Resource1.nwind_proto; // using (var ms = new MemoryStream(blob)) // { // var db = (DAL.DatabaseCompat)new MySerializer().Deserialize(ms, null, typeof(DAL.DatabaseCompat)); // int i = db.Orders.Count; // } //} //catch (Exception ex) //{ // Debug.WriteLine(ex.Message); //} }