9using System.ComponentModel;
10using System.Collections.Generic;
13using System.Reflection;
15using System.Diagnostics;
27 [System.Diagnostics.DebuggerStepThrough]
44 [DebuggerBrowsable(DebuggerBrowsableState.Never)]
49 if (_loadListModeObject ==
null)
52 SetLoadListMode(
true);
54 return _loadListModeObject;
59 _loadListModeObject =
null;
60 SetLoadListMode(enabled);
62 _oldRLCE =
new Stack<bool>();
65 _oldRLCE.Push(RaiseListChangedEvents);
66 RaiseListChangedEvents =
false;
70 if (_oldRLCE.Count > 0)
71 RaiseListChangedEvents = _oldRLCE.Pop();
77 private Stack<bool> _oldRLCE;
93 [EditorBrowsable(EditorBrowsableState.Never)]
94#pragma warning disable CA1063
96#pragma warning restore CA1063
112#pragma warning disable CA1063
114#pragma warning restore CA1063
116 _target.SetLoadListMode(
false);
117 GC.SuppressFinalize(
this);
123 #region IMobileObject Members
140 [EditorBrowsable(EditorBrowsableState.Advanced)]
143 info.
AddValue(
"Csla.Core.MobileList.AllowEdit", AllowEdit);
144 info.
AddValue(
"Csla.Core.MobileList.AllowNew", AllowNew);
145 info.
AddValue(
"Csla.Core.MobileList.AllowRemove", AllowRemove);
146 info.
AddValue(
"Csla.Core.MobileList.RaiseListChangedEvents", RaiseListChangedEvents);
147#if (ANDROID || IOS) || NETFX_CORE
148 info.
AddValue(
"Csla.Core.MobileList._supportsChangeNotificationCore", SupportsChangeNotificationCore);
158 [EditorBrowsable(EditorBrowsableState.Advanced)]
164 List<int> references =
new List<int>();
165 for (
int x = 0; x < this.Count; x++)
174 if (references.Count > 0)
193 [EditorBrowsable(EditorBrowsableState.Advanced)]
196 AllowEdit = info.GetValue<
bool>(
"Csla.Core.MobileList.AllowEdit");
197 AllowNew = info.GetValue<
bool>(
"Csla.Core.MobileList.AllowNew");
198 AllowRemove = info.GetValue<
bool>(
"Csla.Core.MobileList.AllowRemove");
199 RaiseListChangedEvents = info.GetValue<
bool>(
"Csla.Core.MobileList.RaiseListChangedEvents");
208 [EditorBrowsable(EditorBrowsableState.Advanced)]
214 bool originalRaiseListChangedEvents = this.RaiseListChangedEvents;
218 this.RaiseListChangedEvents =
false;
220 if (info.
Values.ContainsKey(
"$list"))
222 List<int> references = (List<int>)info.
Values[
"$list"].Value;
223 foreach (
int reference in references)
225 T child = (T)formatter.
GetObject(reference);
232 this.RaiseListChangedEvents = originalRaiseListChangedEvents;
Class that allows setting of property values on current business object without raising PropertyChang...
LoadListModeObject(IMobileList target)
Create instance of type
void Dispose()
Disposes the object.
Inherit from this base class to easily create a serializable list class.
virtual void OnSetState(SerializationInfo info)
Override this method to set custom field values into the serialization stream.
virtual void OnGetState(SerializationInfo info)
Override this method to get custom field values from the serialization stream.
virtual void OnSetChildren(SerializationInfo info, MobileFormatter formatter)
Override this method to set custom child object values into the serialization stream.
virtual void OnGetChildren(SerializationInfo info, MobileFormatter formatter)
Override this method to get custom child object values from the serialization stream.
LoadListModeObject LoadListMode
By wrapping this property inside Using block you can set property values on current business object w...
virtual void SetLoadListMode(bool enabled)
Sets the load list mode for the list
A strongly-typed resource class, for looking up localized strings, etc.
static string CannotSerializeCollectionsNotOfIMobileObject
Looks up a localized string similar to Cannot serialize collections not of type IMobileObject.
Object containing the serialization data for a specific object.
Dictionary< string, FieldData > Values
Dictionary containg field data.
int ReferenceId
Reference number for this object.
void AddValue(string name, object value)
Adds a value to the serialization stream.
Extension of IMobileObject for list types
void SetLoadListMode(bool enabled)
Sets the LoadListMode for the collection
Interface to be implemented by any object that supports serialization by the SerializationFormatterFa...
void GetChildren(SerializationInfo info, MobileFormatter formatter)
Method called by MobileFormatter when an object should serialize its child references.
void GetState(SerializationInfo info)
Method called by MobileFormatter when an object should serialize its data.
void SetChildren(SerializationInfo info, MobileFormatter formatter)
Method called by MobileFormatter when an object should deserialize its child references.
void SetState(SerializationInfo info)
Method called by MobileFormatter when an object should be deserialized.
@ Serializable
Prevents updating or inserting until the transaction is complete.