9using System.ComponentModel;
10using System.ComponentModel.DataAnnotations;
24 private readonly
bool _isChild = typeof(T).IsAssignableFrom(typeof(
IMobileObject));
26 private bool _isDirty;
47 public string Name {
get;
private set; }
74 this.
Value =
default(T);
76 this.
Value = (T)value;
80 bool ITrackStatus.IsDeleted
84 if (_data is ITrackStatus child)
85 return child.IsDeleted;
91 bool ITrackStatus.IsSavable
96 bool ITrackStatus.IsChild
100 if (_data is ITrackStatus child)
101 return child.IsChild;
125 return child.IsDirty;
150 bool ITrackStatus.IsSelfValid
152 get {
return IsValid; }
157 get {
return IsValid; }
164 protected virtual bool IsValid
177 add {
throw new NotImplementedException(); }
178 remove {
throw new NotImplementedException(); }
186 [Display(AutoGenerateField =
false)]
187 [System.ComponentModel.DataAnnotations.ScaffoldColumn(
false)]
194 isBusy = child.IsBusy;
205 T IFieldData<T>.Value {
get =>
Value;
set =>
Value = value; }
207 string IFieldData.Name =>
Name;
209 bool ITrackStatus.IsDirty =>
IsDirty;
211 bool ITrackStatus.IsSelfDirty =>
IsDirty;
213 bool INotifyBusy.IsBusy =>
IsBusy;
217 private EventHandler<ErrorEventArgs> _unhandledAsyncException;
225 add { _unhandledAsyncException = (EventHandler<ErrorEventArgs>)Delegate.Combine(_unhandledAsyncException, value); }
226 remove { _unhandledAsyncException = (EventHandler<ErrorEventArgs>)Delegate.Remove(_unhandledAsyncException, value); }
231 add { _unhandledAsyncException = (EventHandler<ErrorEventArgs>)Delegate.Combine(_unhandledAsyncException, value); }
232 remove { _unhandledAsyncException = (EventHandler<ErrorEventArgs>)Delegate.Remove(_unhandledAsyncException, value); }
235 void IFieldData.MarkClean()
246 info.
AddValue(
"_isDirty", _isDirty);
264 Name = info.GetValue<
string>(
"_name");
265 _data = info.GetValue<T>(
"_data");
266 _isDirty = info.GetValue<
bool>(
"_isDirty");
274 Name = info.GetValue<
string>(
"_name");
276 _data = (T)formatter.
GetObject(childData.ReferenceId);
Contains a field value and related metadata.
FieldData(string name)
Creates a new instance of the object.
virtual T Value
Gets or sets the value of the field.
string Name
Gets the name of the field.
bool IsBusy
Gets a value indicating whether this object or any of its child objects are busy.
virtual bool IsSelfDirty
Gets a value indicating whether the field has been changed.
virtual void MarkClean()
Marks the field as unchanged.
EventHandler< ErrorEventArgs > UnhandledAsyncException
Event indicating that an exception occurred on a background thread.
virtual bool IsDirty
Gets a value indicating whether the field has been changed.
FieldData()
Creates a new instance of the object.
Object that contains information about a single child reference.
Object containing the serialization data for a specific object.
int ReferenceId
Reference number for this object.
Dictionary< string, ChildData > Children
Dictionary containing child reference data.
void AddChild(string name, int referenceId)
Adds a child to the list of child references.
void AddValue(string name, object value)
Adds a value to the serialization stream.
Defines the members required by a field data storage object.
object Value
Gets or sets the field value.
Interface defining an object that notifies when it is busy executing an asynchronous operation.
bool IsSelfBusy
Gets a value indicating whether the object is busy running an asynchronous operation.
BusyChangedEventHandler BusyChanged
Event raised when the object's busy status changes.
Implemented by an object that perfoms asynchronous operations that may raise exceptions.
EventHandler< ErrorEventArgs > UnhandledAsyncException
Event indicating that an exception occurred during an asynchronous operation.
Defines the common properties required objects that track their own status.
bool IsNew
Returns true if this is a new object, false if it is a pre-existing object.
bool IsValid
Returns true if the object and its child objects are currently valid, false if the object or any of i...
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.
delegate void BusyChangedEventHandler(object sender, BusyChangedEventArgs e)
Delegate for handling the BusyChanged event.
@ Serializable
Prevents updating or inserting until the transaction is complete.