CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
CustomMobileList.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="CustomMobileList.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>no summary</summary>
7//-----------------------------------------------------------------------
8using System;
9using System.Linq;
10using System.Net;
11using System.Windows;
12using System.Windows.Controls;
13using System.Windows.Documents;
14using System.Windows.Ink;
15using System.Windows.Input;
16using System.Windows.Media;
17using System.Windows.Media.Animation;
18using System.Windows.Shapes;
19using Csla.Core;
21using System.Xml;
22using System.Text;
23using System.IO;
25using serialization = System.Runtime.Serialization;
26
28{
29 [Serializable]
30 public class CustomMobileList : MobileBindingList<MockNonBusinessObject>
31 {
32 //protected override void OnSetState(SerializationInfo info)
33 //{
34 // string xml = info.GetValue<string>("$items");
35 // using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
36 // {
37 // XmlReader reader = Csla.Serialization.Mobile.MobileFormatter.GetXmlReader(stream); // XmlReader.Create(stream);
38 // serialization.DataContractSerializer dcs = new serialization.DataContractSerializer(typeof(MockNonBusinessObject[]));
39 // MockNonBusinessObject[] items = (MockNonBusinessObject[])dcs.ReadObject(reader);
40
41 // foreach (MockNonBusinessObject mock in items)
42 // Add(mock);
43 // }
44
45 // base.OnSetState(info);
46 //}
47
48 //protected override void OnGetState(SerializationInfo info)
49 //{
50 // using (MemoryStream stream = new MemoryStream())
51 // {
52 // XmlWriter writer = Csla.Serialization.Mobile.MobileFormatter.GetXmlWriter(stream); // XmlWriter.Create(stream);
53 // serialization.DataContractSerializer dcs = new serialization.DataContractSerializer(typeof(MockNonBusinessObject[]));
54 // dcs.WriteObject(writer, Items.ToArray());
55 // writer.Flush();
56
57 // byte[] buffer = stream.ToArray();
58 // string xml = Encoding.UTF8.GetString(buffer, 0, buffer.Length);
59 // info.AddValue("$items", xml);
60 // }
61 // base.OnGetState(info);
62 //}
63
64 protected override void OnGetChildren(SerializationInfo info, MobileFormatter formatter)
65 {
66 }
67
68 protected override void OnSetChildren(SerializationInfo info, MobileFormatter formatter)
69 {
70 }
71 }
72}
System.Runtime.Serialization serialization
Inherit from this base class to easily create a serializable list class.
Serializes and deserializes objects at the field level.
Object containing the serialization data for a specific object.
override void OnSetChildren(SerializationInfo info, MobileFormatter formatter)
override void OnGetChildren(SerializationInfo info, MobileFormatter formatter)