9using System.Collections.Concurrent;
10using System.Diagnostics;
12using System.Collections.Generic;
13using System.ComponentModel;
14using System.Threading.Tasks;
16using System.Collections.Specialized;
17using System.ComponentModel.DataAnnotations;
18using System.Collections.ObjectModel;
27using System.Reflection;
37 [System.Diagnostics.DebuggerStepThrough]
63 InitializeBusinessRules();
80 private int _identity = -1;
84 get {
return _identity; }
87 private void InitializeIdentity()
89 _identity = ((IParent)
this).GetNextIdentity(_identity);
94 private IdentityManager _identityManager;
96 int IParent.GetNextIdentity(
int current)
104 if (_identityManager ==
null)
105 _identityManager =
new IdentityManager();
106 return _identityManager.GetNextIdentity(current);
112 #region Parent/Child link
116 private IParent _parent;
126 [Display(AutoGenerateField =
false)]
127 [ScaffoldColumn(
false)]
128 [EditorBrowsable(EditorBrowsableState.Advanced)]
131 get {
return _parent; }
143 _identityManager =
null;
144 InitializeIdentity();
149 #region IsNew, IsDeleted, IsDirty, IsSavable
152 private bool _isNew =
true;
153 private bool _isDeleted;
154 private bool _isDirty =
true;
170 [Display(AutoGenerateField =
false)]
171 [ScaffoldColumn(
false)]
174 get {
return _isNew; }
192 [Display(AutoGenerateField =
false)]
193 [ScaffoldColumn(
false)]
196 get {
return _isDeleted; }
219 [Display(AutoGenerateField =
false)]
220 [ScaffoldColumn(
false)]
244 [Display(AutoGenerateField =
false)]
245 [ScaffoldColumn(
false)]
248 get {
return _isDirty; }
345 [EditorBrowsable(EditorBrowsableState.Advanced)]
389 if (ApplicationContext.PropertyChangedMode != ApplicationContext.PropertyChangedModes.Windows)
397 [EditorBrowsable(EditorBrowsableState.Advanced)]
401 if (ApplicationContext.PropertyChangedMode == ApplicationContext.PropertyChangedModes.Windows)
404 foreach (var name
in propertyNames)
414 if (ApplicationContext.PropertyChangedMode == ApplicationContext.PropertyChangedModes.Windows)
419 foreach (var name
in propertyNames)
432 [EditorBrowsable(EditorBrowsableState.Advanced)]
436 if (_fieldManager !=
null)
456 [Display(AutoGenerateField =
false)]
457 [ScaffoldColumn(
false)]
475 #region Authorization
479 private ConcurrentDictionary<string, bool> _readResultCache;
482 private ConcurrentDictionary<string, bool> _writeResultCache;
485 private ConcurrentDictionary<string, bool> _executeResultCache;
488 private System.Security.Principal.IPrincipal _lastPrincipal;
495 [EditorBrowsable(EditorBrowsableState.Advanced)]
500 VerifyAuthorizationCache();
502 if (!_readResultCache.TryGetValue(property.Name, out result))
508 _readResultCache.AddOrUpdate(property.Name, result, (a,b) => { return result; });
522 [EditorBrowsable(EditorBrowsableState.Advanced)]
526 if (throwOnFalse && result ==
false)
529 String.Format(
"{0} ({1})",
541 [EditorBrowsable(EditorBrowsableState.Advanced)]
557 if (propertyInfo ==
null)
559 Trace.TraceError(
"CanReadProperty: {0} is not a registered property of {1}.{2}", propertyName, this.GetType().Namespace, this.GetType().Name);
570 [EditorBrowsable(EditorBrowsableState.Advanced)]
575 VerifyAuthorizationCache();
577 if (!_writeResultCache.TryGetValue(property.Name, out result))
583 _writeResultCache.AddOrUpdate(property.Name, result, (a, b) => { return result; });
597 [EditorBrowsable(EditorBrowsableState.Advanced)]
601 if (throwOnFalse && result ==
false)
615 [EditorBrowsable(EditorBrowsableState.Advanced)]
631 if (propertyInfo ==
null)
633 Trace.TraceError(
"CanReadProperty: {0} is not a registered property of {1}.{2}", propertyName, this.GetType().Namespace, this.GetType().Name);
639 private void VerifyAuthorizationCache()
641 if (_readResultCache ==
null)
642 _readResultCache =
new ConcurrentDictionary<string, bool>();
643 if (_writeResultCache ==
null)
644 _writeResultCache =
new ConcurrentDictionary<string, bool>();
645 if (_executeResultCache ==
null)
646 _executeResultCache =
new ConcurrentDictionary<string, bool>();
650 _readResultCache.Clear();
651 _writeResultCache.Clear();
652 _executeResultCache.Clear();
663 [EditorBrowsable(EditorBrowsableState.Advanced)]
668 VerifyAuthorizationCache();
670 if (!_executeResultCache.TryGetValue(method.Name, out result))
676 _executeResultCache.AddOrUpdate(method.Name, result, (a, b) => { return result; });
690 [EditorBrowsable(EditorBrowsableState.Advanced)]
695 if (throwOnFalse && result ==
false)
712 [EditorBrowsable(EditorBrowsableState.Advanced)]
722 if (throwOnFalse && result ==
false)
732#region System.ComponentModel.IEditableObject
734 private bool _neverCommitted =
true;
736 private bool _disableIEditableObject;
754 [EditorBrowsable(EditorBrowsableState.Advanced)]
759 return _disableIEditableObject;
763 _disableIEditableObject = value;
775 void System.ComponentModel.IEditableObject.BeginEdit()
794 void System.ComponentModel.IEditableObject.CancelEdit()
800 if (
IsNew && _neverCommitted && EditLevel <= EditLevelAdded)
822 void System.ComponentModel.IEditableObject.EndEdit()
833#region Begin/Cancel/ApplyEdit
855 CopyState(this.EditLevel + 1);
869 UndoChanges(this.EditLevel - 1);
883 InitializeBusinessRules();
885 base.UndoChangesComplete();
898 _neverCommitted =
false;
899 AcceptChanges(this.EditLevel - 1);
911 base.AcceptChangesComplete();
923 private bool _isChild;
929 [Display(AutoGenerateField =
false)]
930 [ScaffoldColumn(
false)]
933 get {
return _isChild; }
976 internal void DeleteChild()
987#region Edit Level Tracking (child only)
993 private int _editLevelAdded;
1003 internal int EditLevelAdded
1005 get {
return _editLevelAdded; }
1006 set { _editLevelAdded = value; }
1009 int IUndoableObject.EditLevel
1013 return this.EditLevel;
1021 object ICloneable.Clone()
1032 [EditorBrowsable(EditorBrowsableState.Advanced)]
1035 return ObjectCloner.Clone(
this);
1040#region BusinessRules, IsValid
1044 private EventHandler _validationCompleteHandlers;
1053 _validationCompleteHandlers = (EventHandler)
1054 System.Delegate.Combine(_validationCompleteHandlers, value);
1058 _validationCompleteHandlers = (EventHandler)
1059 System.Delegate.Remove(_validationCompleteHandlers, value);
1066 [EditorBrowsable(EditorBrowsableState.Never)]
1069 if (_validationCompleteHandlers !=
null)
1070 _validationCompleteHandlers(
this, EventArgs.Empty);
1073 private void InitializeBusinessRules()
1076 if (!rules.Initialized)
1078 if (!rules.Initialized)
1083 rules.Initialized =
true;
1107 if (_businessRules ==
null)
1109 else if (_businessRules.Target ==
null)
1110 _businessRules.SetTarget(
this);
1111 return _businessRules;
1119 [EditorBrowsable(EditorBrowsableState.Never)]
1133 OnBusyChanged(
new BusyChangedEventArgs(property.Name,
false));
1147 void Rules.IHostRules.AllRulesComplete()
1190 [Display(AutoGenerateField =
false)]
1191 [ScaffoldColumn(
false)]
1213 [Display(AutoGenerateField =
false)]
1214 [ScaffoldColumn(
false)]
1225 [Display(AutoGenerateField =
false)]
1226 [ScaffoldColumn(
false)]
1227 [System.ComponentModel.DataAnnotations.Schema.NotMapped]
1228 [EditorBrowsable(EditorBrowsableState.Advanced)]
1243 [EditorBrowsable(EditorBrowsableState.Advanced)]
1252 [EditorBrowsable(EditorBrowsableState.Advanced)]
1262 [EditorBrowsable(EditorBrowsableState.Advanced)]
1285 [EditorBrowsable(EditorBrowsableState.Advanced)]
1294 [EditorBrowsable(EditorBrowsableState.Advanced)]
1304 [EditorBrowsable(EditorBrowsableState.Advanced)]
1310#region IDataErrorInfo
1312 string IDataErrorInfo.Error
1324 string IDataErrorInfo.this[
string columnName]
1328 string result =
string.Empty;
1331 Rules.BrokenRule rule =
1342#region Serialization Notification
1346 OnDeserializedHandler(
new System.Runtime.Serialization.StreamingContext());
1349 [System.Runtime.Serialization.OnDeserialized]
1350 private void OnDeserializedHandler(System.Runtime.Serialization.StreamingContext context)
1353 if (_fieldManager !=
null)
1355 InitializeBusinessRules();
1356 FieldDataDeserialized();
1366 [EditorBrowsable(EditorBrowsableState.Advanced)]
1367 protected virtual void OnDeserialized(System.Runtime.Serialization.StreamingContext context)
1372#region Bubbling event Hooks
1378 [EditorBrowsable(EditorBrowsableState.Never)]
1388 [EditorBrowsable(EditorBrowsableState.Never)]
1396 if (unhandled !=
null)
1399 INotifyPropertyChanged pc = child as INotifyPropertyChanged;
1401 pc.PropertyChanged += Child_PropertyChanged;
1403 IBindingList bl = child as IBindingList;
1405 bl.ListChanged += Child_ListChanged;
1407 INotifyCollectionChanged ncc = child as INotifyCollectionChanged;
1409 ncc.CollectionChanged += Child_CollectionChanged;
1420 [EditorBrowsable(EditorBrowsableState.Never)]
1430 [EditorBrowsable(EditorBrowsableState.Never)]
1438 if (unhandled !=
null)
1441 INotifyPropertyChanged pc = child as INotifyPropertyChanged;
1443 pc.PropertyChanged -= Child_PropertyChanged;
1445 IBindingList bl = child as IBindingList;
1447 bl.ListChanged -= Child_ListChanged;
1449 INotifyCollectionChanged ncc = child as INotifyCollectionChanged;
1451 ncc.CollectionChanged -= Child_CollectionChanged;
1460#region Busy / Unhandled exception bubbling
1462 private void Child_UnhandledAsyncException(
object sender,
ErrorEventArgs e)
1467 private void Child_BusyChanged(
object sender, BusyChangedEventArgs e)
1474#region IEditableBusinessObject Members
1476 int IEditableBusinessObject.EditLevelAdded
1480 return this.EditLevelAdded;
1484 this.EditLevelAdded = value;
1488 void IEditableBusinessObject.DeleteChild()
1493 void IEditableBusinessObject.SetParent(IParent parent)
1500#region Register Methods
1517 var reflected = objectType.GetMethod(info.
Name);
1518 if (reflected ==
null)
1545#region Register Properties
1565 return Core.FieldManager.PropertyInfoManager.RegisterProperty<P>(objectType, info);
1570#region Get Properties
1592 return GetProperty<P>(propertyName, field, defaultValue, Security.NoAccessBehavior.SuppressException);
1611 protected P
GetProperty<P>(
string propertyName, P field, P defaultValue, Security.NoAccessBehavior noAccess)
1613#region Check to see if the property is marked with RelationshipTypes.PrivateField
1622 if (_bypassPropertyChecks ||
CanReadProperty(propertyInfo, noAccess == Security.NoAccessBehavior.ThrowException))
1625 return defaultValue;
1690 return Utilities.CoerceValue<P>(typeof(F),
null, GetProperty<F>(propertyInfo.
Name, field, propertyInfo.
DefaultValue, Security.NoAccessBehavior.SuppressException));
1717 return Utilities.CoerceValue<P>(typeof(F),
null, GetProperty<F>(propertyInfo.
Name, field, propertyInfo.
DefaultValue, noAccess));
1736 return GetProperty<P>(propertyInfo, Security.NoAccessBehavior.SuppressException);
1759 return Utilities.CoerceValue<P>(typeof(F),
null, GetProperty<F>(propertyInfo, Security.NoAccessBehavior.SuppressException));
1785 return Utilities.CoerceValue<P>(typeof(F),
null, GetProperty<F>(propertyInfo, noAccess));
1807 P result =
default(P);
1827 object result =
null;
1876 var result = valueGenerator();
1910 _lazyLoadingProperties.Add(property);
1911 LoadPropertyAsync(property, factory);
1916 object IManageProperties.LazyGetProperty<P>(
PropertyInfo<P> propertyInfo, Func<P> valueGenerator)
1918 return LazyGetProperty(propertyInfo, valueGenerator);
1921 object IManageProperties.LazyGetPropertyAsync<P>(
PropertyInfo<P> propertyInfo, Task<P> factory)
1923 return LazyGetPropertyAsync(propertyInfo, factory);
1928#region Read Properties
1945 return Utilities.CoerceValue<P>(typeof(F),
null, ReadProperty<F>(propertyInfo));
1961 P result =
default(P);
1969 result = (P)data.Value;
1991 using (BypassPropertyChecks)
1993 return MethodCaller.CallPropertyGetter(
this, propertyInfo.
Name);
1997 object result =
null;
2001 result = info.
Value;
2025 var result = valueGenerator();
2044 _lazyLoadingProperties.Add(property);
2045 LoadPropertyAsync(property, factory);
2050 P IManageProperties.LazyReadProperty<P>(
PropertyInfo<P> propertyInfo, Func<P> valueGenerator)
2052 return LazyReadProperty(propertyInfo, valueGenerator);
2055 P IManageProperties.LazyReadPropertyAsync<P>(
PropertyInfo<P> propertyInfo, Task<P> factory)
2057 return LazyReadPropertyAsync(propertyInfo, factory);
2062#region Set Properties
2081 SetProperty<P>(propertyInfo.
Name, ref field, newValue, Security.NoAccessBehavior.ThrowException);
2101 SetProperty<P>(propertyName, ref field, newValue, Security.NoAccessBehavior.ThrowException);
2173 protected void SetProperty<P>(
string propertyName, ref P field, P newValue, Security.NoAccessBehavior noAccess)
2177#region Check to see if the property is marked with RelationshipTypes.PrivateField
2186 if (_bypassPropertyChecks ||
CanWriteProperty(propertyInfo, noAccess == Security.NoAccessBehavior.ThrowException))
2188 bool doChange =
false;
2191 if (newValue !=
null)
2196 if (typeof(P) == typeof(
string) && newValue ==
null)
2197 newValue = Utilities.CoerceValue<P>(typeof(
string), field,
string.Empty);
2198 if (!field.Equals(newValue))
2209 catch (System.Security.SecurityException ex)
2217 catch (Exception ex)
2252#region Check to see if the property is marked with RelationshipTypes.PrivateField
2261 if (_bypassPropertyChecks ||
CanWriteProperty(propertyInfo, noAccess == Security.NoAccessBehavior.ThrowException))
2263 bool doChange =
false;
2266 if (newValue !=
null)
2271 if (typeof(V) == typeof(
string) && newValue ==
null)
2272 newValue = Utilities.CoerceValue<V>(typeof(
string),
null,
string.Empty);
2273 if (!field.Equals(newValue))
2279 field = Utilities.CoerceValue<P>(typeof(V), field, newValue);
2284 catch (System.Security.SecurityException ex)
2292 catch (Exception ex)
2295 string.Format(Properties.Resources.PropertyLoadException, propertyName, ex.Message), ex);
2315 SetProperty<P>(propertyInfo, newValue, Security.NoAccessBehavior.ThrowException);
2352 if (_bypassPropertyChecks ||
CanWriteProperty(propertyInfo, noAccess == Security.NoAccessBehavior.ThrowException))
2354 P oldValue =
default(P);
2356 if (fieldData ==
null)
2359 fieldData =
FieldManager.LoadFieldData<P>(propertyInfo, oldValue);
2365 oldValue = fd.Value;
2367 oldValue = (P)fieldData.Value;
2369 if (typeof(F) == typeof(
string) && newValue ==
null)
2370 newValue = Utilities.CoerceValue<F>(typeof(
string),
null,
string.Empty);
2371 LoadPropertyValue<P>(propertyInfo, oldValue, Utilities.CoerceValue<P>(typeof(F), oldValue, newValue), !_bypassPropertyChecks);
2374 catch (System.Security.SecurityException ex)
2382 catch (Exception ex)
2385 string.Format(Properties.Resources.PropertyLoadException, propertyInfo.
Name, ex.Message), ex);
2406 if (_bypassPropertyChecks ||
CanWriteProperty(propertyInfo, noAccess == Security.NoAccessBehavior.ThrowException))
2410 P oldValue =
default(P);
2412 if (fieldData ==
null)
2415 fieldData =
FieldManager.LoadFieldData<P>(propertyInfo, oldValue);
2421 oldValue = fd.Value;
2423 oldValue = (P)fieldData.Value;
2425 if (typeof(P) == typeof(
string) && newValue ==
null)
2426 newValue = Utilities.CoerceValue<P>(typeof(
string),
null,
string.Empty);
2427 LoadPropertyValue<P>(propertyInfo, oldValue, newValue, !_bypassPropertyChecks);
2429 catch (Exception ex)
2432 string.Format(Properties.Resources.PropertyLoadException, propertyInfo.
Name, ex.Message), ex);
2461 catch (System.Security.SecurityException ex)
2469 catch (Exception ex)
2499#region Load Properties
2519 P oldValue =
default(P);
2521 if (fieldData ==
null)
2524 fieldData =
FieldManager.LoadFieldData<P>(propertyInfo, oldValue);
2530 oldValue = fd.Value;
2532 oldValue = (P)fieldData.Value;
2534 LoadPropertyValue<P>(propertyInfo, oldValue, Utilities.CoerceValue<P>(typeof(F), oldValue, newValue),
false);
2536 catch (Exception ex)
2539 string.Format(Properties.Resources.PropertyLoadException, propertyInfo.
Name, ex.Message), ex);
2543 void Core.IManageProperties.LoadProperty<P>(
PropertyInfo<P> propertyInfo, P newValue)
2545 LoadProperty<P>(propertyInfo, newValue);
2548 bool Core.IManageProperties.FieldExists(Core.IPropertyInfo property)
2574 P oldValue =
default(P);
2576 if (fieldData ==
null)
2579 fieldData =
FieldManager.LoadFieldData<P>(propertyInfo, oldValue);
2585 oldValue = fd.Value;
2587 oldValue = (P)fieldData.Value;
2589 LoadPropertyValue<P>(propertyInfo, oldValue, newValue,
false);
2591 catch (Exception ex)
2594 string.Format(Properties.Resources.PropertyLoadException, propertyInfo.
Name, ex.Message), ex);
2619 P oldValue =
default(P);
2621 if (fieldData ==
null)
2624 fieldData =
FieldManager.LoadFieldData<P>(propertyInfo, oldValue);
2630 oldValue = fd.Value;
2632 oldValue = (P)fieldData.Value;
2635 var valuesDiffer = ValuesDiffer(propertyInfo, newValue, oldValue);
2649 ResetChildEditLevel(newValue);
2654 ResetChildEditLevel(newValue);
2661 return valuesDiffer;
2663 catch (Exception ex)
2665 throw new PropertyLoadException(
string.Format(Properties.Resources.PropertyLoadException, propertyInfo.
Name, ex.Message), ex);
2677 private static bool ValuesDiffer<P>(
PropertyInfo<P> propertyInfo, P newValue, P oldValue)
2679 var valuesDiffer =
false;
2680 if (oldValue ==
null)
2681 valuesDiffer = newValue !=
null;
2687 valuesDiffer = !(ReferenceEquals(oldValue, newValue));
2691 valuesDiffer = !(oldValue.Equals(newValue));
2694 return valuesDiffer;
2697 private void LoadPropertyValue<P>(PropertyInfo<P> propertyInfo, P oldValue, P newValue,
bool markDirty)
2699 var valuesDiffer = ValuesDiffer(propertyInfo, newValue, oldValue);
2704 IBusinessObject old = oldValue as IBusinessObject;
2707 IBusinessObject @
new = newValue as IBusinessObject;
2712 if (typeof(IEditableBusinessObject).IsAssignableFrom(propertyInfo.Type))
2724 ResetChildEditLevel(newValue);
2726 else if (typeof(IEditableCollection).IsAssignableFrom(propertyInfo.Type))
2738 ResetChildEditLevel(newValue);
2781 if (propertyInfo.
Type == typeof(
int?))
2785 else if (propertyInfo.
Type == typeof(
bool?))
2793 else if (propertyInfo.
Type == typeof(decimal?))
2797 else if (propertyInfo.
Type == typeof(
double?))
2801 else if (propertyInfo.
Type == typeof(
long?))
2805 else if (propertyInfo.
Type == typeof(
byte?))
2809 else if (propertyInfo.
Type == typeof(
char?))
2813 else if (propertyInfo.
Type == typeof(
short?))
2817 else if (propertyInfo.
Type == typeof(uint?))
2821 else if (propertyInfo.
Type == typeof(ulong?))
2825 else if (propertyInfo.
Type == typeof(ushort?))
2831 return (
bool)LoadPropertyByReflection(
"LoadPropertyMarkDirty", propertyInfo, newValue);
2834 return (
bool)LoadPropertyByReflection(
"LoadPropertyMarkDirty", propertyInfo, newValue);
2857 if (propertyInfo.
Type == typeof(
int?))
2861 else if (propertyInfo.
Type == typeof(
bool?))
2869 else if (propertyInfo.
Type == typeof(decimal?))
2873 else if (propertyInfo.
Type == typeof(
double?))
2877 else if (propertyInfo.
Type == typeof(
long?))
2881 else if (propertyInfo.
Type == typeof(
byte?))
2885 else if (propertyInfo.
Type == typeof(
char?))
2889 else if (propertyInfo.
Type == typeof(
short?))
2893 else if (propertyInfo.
Type == typeof(uint?))
2897 else if (propertyInfo.
Type == typeof(ulong?))
2901 else if (propertyInfo.
Type == typeof(ushort?))
2907 LoadPropertyByReflection(
"LoadProperty", propertyInfo, newValue);
2910 LoadPropertyByReflection(
"LoadProperty", propertyInfo, newValue);
2924 private object LoadPropertyByReflection(
string loadPropertyMethodName,
IPropertyInfo propertyInfo,
object newValue)
2926 var t = this.GetType();
2927 var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
2928 var method = t.GetMethods(flags).FirstOrDefault(c => c.Name == loadPropertyMethodName && c.IsGenericMethod);
2929 var gm = method.MakeGenericMethod(propertyInfo.
Type);
2930 var p =
new object[] { propertyInfo, newValue };
2931 return gm.Invoke(
this, p);
2939 private void ResetChildEditLevel(
object newValue)
2941 IEditableBusinessObject child = newValue as IEditableBusinessObject;
2944 child.SetParent(
this);
2948 child.EditLevelAdded = this.EditLevel;
2952 IEditableCollection col = newValue as IEditableCollection;
2955 col.SetParent(
this);
2956 IUndoableObject undo = col as IUndoableObject;
2969 private AsyncLoadManager _loadManager;
2970 internal AsyncLoadManager LoadManager
2974 if (_loadManager ==
null)
2977 _loadManager.BusyChanged += loadManager_BusyChanged;
2978 _loadManager.UnhandledAsyncException += loadManager_UnhandledAsyncException;
2980 return _loadManager;
2984 private void loadManager_UnhandledAsyncException(
object sender, ErrorEventArgs e)
2989 private void loadManager_BusyChanged(
object sender, BusyChangedEventArgs e)
3002 LoadManager.BeginLoad(
new TaskLoader<R>(property, factory));
3007#region IsBusy / IsIdle
3011 private bool _isBusy;
3017 [EditorBrowsable(EditorBrowsableState.Advanced)]
3031 [EditorBrowsable(EditorBrowsableState.Advanced)]
3044 [Display(AutoGenerateField =
false)]
3045 [ScaffoldColumn(
false)]
3056 [Display(AutoGenerateField =
false)]
3057 [ScaffoldColumn(
false)]
3082 if (_busyChanged !=
null)
3083 _busyChanged(
this, args);
3116#region INotifyUnhandledAsyncException Members
3120 private EventHandler<ErrorEventArgs> _unhandledAsyncException;
3128 add { _unhandledAsyncException = (EventHandler<ErrorEventArgs>)Delegate.Combine(_unhandledAsyncException, value); }
3129 remove { _unhandledAsyncException = (EventHandler<ErrorEventArgs>)Delegate.Remove(_unhandledAsyncException, value); }
3136 [EditorBrowsable(EditorBrowsableState.Advanced)]
3139 if (_unhandledAsyncException !=
null)
3140 _unhandledAsyncException(
this, error);
3149 [EditorBrowsable(EditorBrowsableState.Advanced)]
3157#region Child Change Notification
3166 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Design",
3167 "CA1062:ValidateArgumentsOfPublicMethods")]
3173 System.Delegate.Combine(_childChangedHandlers, value);
3178 System.Delegate.Remove(_childChangedHandlers, value);
3189 [EditorBrowsable(EditorBrowsableState.Advanced)]
3192 if (_childChangedHandlers !=
null)
3193 _childChangedHandlers.Invoke(
this, e);
3210 private void RaiseChildChanged(
3211 object childObject, PropertyChangedEventArgs propertyArgs)
3213 ChildChangedEventArgs args =
new ChildChangedEventArgs(childObject, propertyArgs);
3220 private void RaiseChildChanged(
3221 object childObject, PropertyChangedEventArgs propertyArgs, ListChangedEventArgs listArgs)
3223 ChildChangedEventArgs args =
new ChildChangedEventArgs(childObject, propertyArgs, listArgs);
3230 private void RaiseChildChanged(
3231 object childObject, PropertyChangedEventArgs propertyArgs, NotifyCollectionChangedEventArgs listArgs)
3233 ChildChangedEventArgs args =
new ChildChangedEventArgs(childObject, propertyArgs, listArgs);
3242 private void Child_PropertyChanged(
object sender, PropertyChangedEventArgs e)
3247 if (!(e is MetaPropertyChangedEventArgs))
3249 RaiseChildChanged(sender, e);
3258 private void Child_ListChanged(
object sender, ListChangedEventArgs e)
3260 if (e.ListChangedType != ListChangedType.ItemChanged)
3261 RaiseChildChanged(sender,
null, e);
3269 private void Child_CollectionChanged(
object sender, NotifyCollectionChangedEventArgs e)
3271 RaiseChildChanged(sender,
null, e);
3279 private void Child_Changed(
object sender, ChildChangedEventArgs e)
3281 RaiseChildChanged(e);
3286#region Field Manager
3298 if (_fieldManager ==
null)
3303 return _fieldManager;
3307 private void FieldDataDeserialized()
3316 child.SetParent(
this);
3318 if (item is IEditableCollection childCollection)
3320 childCollection.SetParent(
this);
3335 [EditorBrowsable(EditorBrowsableState.Advanced)]
3347 void IParent.RemoveChild(IEditableBusinessObject child)
3355 get {
return this.
Parent; }
3360#region IDataPortalTarget Members
3414#region IManageProperties Members
3416 bool IManageProperties.HasManagedProperties
3418 get {
return (_fieldManager !=
null && _fieldManager.
HasFields); }
3421 List<IPropertyInfo> IManageProperties.GetManagedProperties()
3426 object IManageProperties.GetProperty(IPropertyInfo propertyInfo)
3431 object IManageProperties.ReadProperty(IPropertyInfo propertyInfo)
3436 P IManageProperties.ReadProperty<P>(PropertyInfo<P> propertyInfo)
3441 void IManageProperties.SetProperty(IPropertyInfo propertyInfo,
object newValue)
3446 void IManageProperties.LoadProperty(IPropertyInfo propertyInfo,
object newValue)
3451 bool IManageProperties.LoadPropertyMarkDirty(IPropertyInfo propertyInfo,
object newValue)
3456 List<object> IManageProperties.GetChildren()
3462#region MobileFormatter
3474 [EditorBrowsable(EditorBrowsableState.Advanced)]
3477 base.OnGetState(info, mode);
3478 info.AddValue(
"Csla.Core.BusinessBase._isNew", _isNew);
3479 info.AddValue(
"Csla.Core.BusinessBase._isDeleted", _isDeleted);
3480 info.AddValue(
"Csla.Core.BusinessBase._isDirty", _isDirty);
3481 info.AddValue(
"Csla.Core.BusinessBase._neverCommitted", _neverCommitted);
3482 info.AddValue(
"Csla.Core.BusinessBase._disableIEditableObject", _disableIEditableObject);
3483 info.AddValue(
"Csla.Core.BusinessBase._isChild", _isChild);
3484 info.AddValue(
"Csla.Core.BusinessBase._editLevelAdded", _editLevelAdded);
3485 info.AddValue(
"Csla.Core.BusinessBase._identity", _identity);
3498 [EditorBrowsable(EditorBrowsableState.Advanced)]
3501 base.OnSetState(info, mode);
3502 _isNew = info.GetValue<
bool>(
"Csla.Core.BusinessBase._isNew");
3503 _isDeleted = info.GetValue<
bool>(
"Csla.Core.BusinessBase._isDeleted");
3504 _isDirty = info.GetValue<
bool>(
"Csla.Core.BusinessBase._isDirty");
3505 _neverCommitted = info.GetValue<
bool>(
"Csla.Core.BusinessBase._neverCommitted");
3506 _disableIEditableObject = info.GetValue<
bool>(
"Csla.Core.BusinessBase._disableIEditableObject");
3507 _isChild = info.GetValue<
bool>(
"Csla.Core.BusinessBase._isChild");
3509 _editLevelAdded = info.GetValue<
int>(
"Csla.Core.BusinessBase._editLevelAdded");
3510 _identity = info.GetValue<
int>(
"Csla.Core.BusinessBase._identity");
3524 [EditorBrowsable(EditorBrowsableState.Advanced)]
3528 base.OnGetChildren(info, formatter);
3530 if (_fieldManager !=
null)
3532 var fieldManagerInfo = formatter.SerializeObject(_fieldManager);
3533 info.AddChild(
"_fieldManager", fieldManagerInfo.ReferenceId);
3536 if (_businessRules !=
null)
3538 var vrInfo = formatter.SerializeObject(_businessRules);
3539 info.AddChild(
"_businessRules", vrInfo.ReferenceId);
3554 [EditorBrowsable(EditorBrowsableState.Advanced)]
3557 if (info.Children.ContainsKey(
"_fieldManager"))
3559 var childData = info.Children[
"_fieldManager"];
3563 if (info.Children.ContainsKey(
"_businessRules"))
3565 int refId = info.Children[
"_businessRules"].ReferenceId;
3574#region Property Checks ByPass
3578 private bool _bypassPropertyChecks =
false;
3583 protected internal bool IsBypassingPropertyChecks {
get {
return _bypassPropertyChecks; } }
3587 private BypassPropertyChecksObject _bypassPropertyChecksObject =
null;
3595 [DebuggerBrowsable(DebuggerBrowsableState.Never)]
3596 protected internal BypassPropertyChecksObject BypassPropertyChecks
3600 return BypassPropertyChecksObject.GetManager(
this);
3610 [EditorBrowsable(EditorBrowsableState.Never)]
3611 protected internal class BypassPropertyChecksObject : IDisposable
3614 private static object _lock =
new object();
3616 internal BypassPropertyChecksObject(
BusinessBase businessObject)
3618 _businessObject = businessObject;
3619 _businessObject._bypassPropertyChecks =
true;
3622#region IDisposable Members
3627 public void Dispose()
3630 GC.SuppressFinalize(
this);
3637 protected virtual void Dispose(
bool dispose)
3647 public static BypassPropertyChecksObject GetManager(
BusinessBase businessObject)
3651 if (businessObject._bypassPropertyChecksObject ==
null)
3652 businessObject._bypassPropertyChecksObject =
new BypassPropertyChecksObject(businessObject);
3654 businessObject._bypassPropertyChecksObject.AddRef();
3656 return businessObject._bypassPropertyChecksObject;
3659#region Reference counting
3661 private int _refCount;
3669 get {
return _refCount; }
3672 private void AddRef()
3677 private void DeRef()
3685 _businessObject._bypassPropertyChecks =
false;
3686 _businessObject._bypassPropertyChecksObject =
null;
3687 _businessObject =
null;
3698#region ISuppressRuleChecking Members
3703 void ICheckRules.SuppressRuleChecking()
3711 void ICheckRules.ResumeRuleChecking()
3719 void ICheckRules.CheckRules()
3727 Task ICheckRules.CheckRulesAsync()
virtual void OnPropertyChanged(string propertyName)
Call this method to raise the PropertyChanged event for a specific property.
virtual void OnMetaPropertyChanged(string propertyName)
virtual void OnUnknownPropertyChanged()
Call this method to raise the PropertyChanged event for all object properties.
virtual void OnPropertyChanging(string propertyName)
Call this method to raise the PropertyChanging event for a specific property.
This is the non-generic base class from which most business objects will be derived.
virtual void CheckObjectRules()
Check object rules and notifies UI of properties that may have changed.
virtual void OnBusyChanged(BusyChangedEventArgs args)
Raise the BusyChanged event.
Core.IParent Parent
Provide access to the parent reference for use in child object code.
void AddEventHooks(IBusinessObject child)
For internal use.
virtual bool IsPropertyBusy(Csla.Core.IPropertyInfo property)
Gets a value indicating whether a specific property is busy (has a currently executing async rule).
virtual bool IsSelfValid
Returns true if the object is currently valid, false if the object has broken rules or is otherwise i...
FieldDataManager FieldManager
Gets the PropertyManager object for this business object.
P LazyReadPropertyAsync< P >(PropertyInfo< P > property, Task< P > factory)
Gets a property's value as a specified type.
virtual bool CanExecuteMethod(string methodName)
Returns true if the user is allowed to execute the specified method.
void RemoveEventHooks(IBusinessObject child)
For internal use only.
virtual void Delete()
Marks the object for deletion.
virtual bool IsBusy
Gets a value indicating if this object or its child objects are busy.
virtual void OnUnhandledAsyncException(ErrorEventArgs error)
Raises the UnhandledAsyncException event.
P LazyGetPropertyAsync< P >(PropertyInfo< P > property, Task< P > factory)
Lazily initializes a property and returns the resulting value.
void ApplyEdit()
Commits the current edit process.
virtual bool IsValid
Returns true if the object and its child objects are currently valid, false if the object or any of i...
virtual void EditChildComplete(Core.IEditableBusinessObject child)
Override this method to be notified when a child object's Core.BusinessBase.ApplyEdit method has comp...
virtual void Child_OnDataPortalInvoke(DataPortalEventArgs e)
Called by the server-side DataPortal prior to calling the requested DataPortal_XYZ method.
bool IsDeleted
Returns true if this object is marked for deletion.
object GetProperty(IPropertyInfo propertyInfo)
Gets a property's value as a specified type.
bool IsPropertyBusy(string propertyName)
Gets a value indicating whether a specific property is busy (has a currently executing async rule).
void MarkAsChild()
Marks the object as being a child object.
static MethodInfo RegisterMethod(Type objectType, string methodName)
Indicates that the specified method belongs to the type.
virtual object GetClone()
Creates a clone of the object.
P LazyGetProperty< P >(PropertyInfo< P > property, Func< P > valueGenerator)
Lazily initializes a property and returns the resulting value.
bool DisableIEditableObject
Gets or sets a value indicating whether the IEditableObject interface methods should be disabled for ...
virtual void AddBusinessRules()
Override this method in your business class to be notified when you need to set up shared business ru...
EventHandler ValidationComplete
Event raised when validation is complete.
void SetPropertyConvert< P, V >(PropertyInfo< P > propertyInfo, ref P field, V newValue)
Sets a property's backing field with the supplied value, first checking authorization,...
virtual void OnRemoveEventHooks(IBusinessObject child)
Unhook child object events.
P LazyReadProperty< P >(PropertyInfo< P > property, Func< P > valueGenerator)
Gets a property's value as a specified type.
virtual bool IsSelfBusy
Gets a value indicating if this object is busy.
virtual void OnValidationComplete()
Raises the ValidationComplete event
BusinessRuleManager GetRegisteredRules()
Gets the registered rules.
virtual object ReadProperty(IPropertyInfo propertyInfo)
Gets a property's value.
void SetProperty< P >(PropertyInfo< P > propertyInfo, ref P field, P newValue)
Sets a property's backing field with the supplied value, first checking authorization,...
override void OnSetState(Csla.Serialization.Mobile.SerializationInfo info, StateMode mode)
Override this method to retrieve your field values from the MobileFormatter serialzation stream.
virtual void Child_OnDataPortalException(DataPortalEventArgs e, Exception ex)
Called by the server-side DataPortal if an exception occurs during data access.
BrokenRulesCollection GetBrokenRules()
Gets the broken rules for this object
BusinessRules BusinessRules
Provides access to the broken rules functionality.
bool CanExecuteMethod(Csla.Core.IMemberInfo method, bool throwOnFalse)
Returns true if the user is allowed to execute the specified method.
void LoadPropertyAsync< R >(PropertyInfo< R > property, Task< R > factory)
Load a property from an async method.
BusinessBase()
Creates an instance of the object.
virtual void Child_Create()
Override this method to load a new business object with default values from the database.
void MarkDeleted()
Marks an object for deletion.
virtual bool CanExecuteMethod(Csla.Core.IMemberInfo method)
Returns true if the user is allowed to execute the specified method.
void SetPropertyConvert< P, F >(PropertyInfo< P > propertyInfo, F newValue)
Sets a property's managed field with the supplied value, first checking authorization,...
void CancelEdit()
Cancels the current edit process, restoring the object's state to its previous values.
virtual void LoadProperty(IPropertyInfo propertyInfo, object newValue)
Loads a property's managed field with the supplied value.
virtual void OnChildChanged(ChildChangedEventArgs e)
Raises the ChildChanged event, indicating that a child object has been changed.
virtual bool LoadPropertyMarkDirty(IPropertyInfo propertyInfo, object newValue)
Loads a property's managed field with the supplied value.
P ReadPropertyConvert< F, P >(PropertyInfo< F > propertyInfo)
Gets a property's value from the list of managed field values, converting the value to an appropriate...
bool CanReadProperty(string propertyName)
Returns true if the user is allowed to read the specified property.
EventHandler< Csla.Core.ChildChangedEventArgs > ChildChanged
Event raised when a child object has been changed.
bool IsNew
Returns true if this is a new object, false if it is a pre-existing object.
override void OnGetChildren(Csla.Serialization.Mobile.SerializationInfo info, Csla.Serialization.Mobile.MobileFormatter formatter)
Override this method to insert your child object references into the MobileFormatter serialzation str...
void MarkDirty(bool suppressEvent)
Marks an object as being dirty, or changed.
virtual bool IsSavable
Returns true if this object is both dirty and valid.
BusyChangedEventHandler BusyChanged
Event indicating that the IsBusy property has changed.
virtual void SetParent(Core.IParent parent)
Used by BusinessListBase as a child object is created to tell the child object about its parent.
virtual void MarkOld()
Marks the object as being an old (not new) object.
virtual void OnDeserialized(System.Runtime.Serialization.StreamingContext context)
This method is called on a newly deserialized object after deserialization is complete.
static Csla.Core.IMemberInfo RegisterMethod(Type objectType, IMemberInfo info)
Indicates that the specified method belongs to the type.
virtual bool IsSelfDirty
Returns true if this object's data has been changed.
EventHandler< ErrorEventArgs > UnhandledAsyncException
Event indicating that an exception occurred during the processing of an async operation.
virtual void PropertyHasChanged(Csla.Core.IPropertyInfo property)
Performs processing required when a property has changed.
virtual bool CanWriteProperty(Csla.Core.IPropertyInfo property)
Returns true if the user is allowed to write the specified property.
virtual Rules.BrokenRulesCollection BrokenRulesCollection
Provides access to the readonly collection of broken business rules for this object.
virtual bool CanReadProperty(Csla.Core.IPropertyInfo property)
Returns true if the user is allowed to read the calling property.
override void UndoChangesComplete()
Called when an undo operation has completed.
void MarkDirty()
Marks an object as being dirty, or changed.
override void AcceptChangesComplete()
Notifies the parent object (if any) that this child object's edits have been accepted.
static PropertyInfo< P > RegisterProperty< P >(Type objectType, PropertyInfo< P > info)
Indicates that the specified property belongs to the type.
virtual void MetaPropertyHasChanged(string name)
Raises OnPropertyChanged for meta properties (IsXYZ) when PropertyChangedMode is not Windows
P GetProperty< P >(string propertyName, P field, P defaultValue)
Gets a property's value, first checking authorization.
virtual void DataPortal_OnDataPortalInvoke(DataPortalEventArgs e)
Called by the server-side DataPortal prior to calling the requested DataPortal_XYZ method.
void LoadPropertyConvert< P, F >(PropertyInfo< P > propertyInfo, F newValue)
Loads a property's managed field with the supplied value.
virtual void DataPortal_OnDataPortalInvokeComplete(DataPortalEventArgs e)
Called by the server-side DataPortal after calling the requested DataPortal_XYZ method.
P GetPropertyConvert< F, P >(PropertyInfo< F > propertyInfo, F field)
Gets a property's value as a specified type, first checking authorization.
virtual void OnAddEventHooks(IBusinessObject child)
Hook child object events.
void OnUnhandledAsyncException(object originalSender, Exception error)
Raises the UnhandledAsyncException event.
override void OnGetState(Csla.Serialization.Mobile.SerializationInfo info, StateMode mode)
Override this method to insert your field values into the MobileFormatter serialzation stream.
bool LoadPropertyMarkDirty< P >(PropertyInfo< P > propertyInfo, P newValue)
Loads a property's managed field with the supplied value and mark field as dirty if value is modified...
bool IsChild
Returns true if this is a child (non-root) object.
virtual bool IsDirty
Returns true if this object's data, or any of its fields or child objects data, has been changed.
virtual void CheckPropertyRules(IPropertyInfo property)
Check rules for the property and notifies UI of properties that may have changed.
bool CanWriteProperty(Csla.Core.IPropertyInfo property, bool throwOnFalse)
Returns true if the user is allowed to write the calling property.
virtual void Initialize()
Override this method to set up event handlers so user code in a partial class can respond to events r...
virtual void DataPortal_OnDataPortalException(DataPortalEventArgs e, Exception ex)
Called by the server-side DataPortal if an exception occurs during data access.
void MarkClean()
Forces the object's IsDirty flag to false.
void MarkIdle()
Mark the object as not busy (it is not running an async operation).
void MarkBusy()
Mark the object as busy (it is running an async operation).
void BeginEdit()
Starts a nested edit on the object.
void SetProperty(IPropertyInfo propertyInfo, object newValue)
Sets a property's managed field with the supplied value, and then calls PropertyHasChanged if the val...
virtual void Child_OnDataPortalInvokeComplete(DataPortalEventArgs e)
Called by the server-side DataPortal after calling the requested DataPortal_XYZ method.
P ReadProperty< P >(PropertyInfo< P > propertyInfo)
Gets a property's value as a specified type.
bool CanWriteProperty(string propertyName)
Returns true if the user is allowed to write the specified property.
virtual void MarkNew()
Marks the object as being a new object.
bool CanReadProperty(Csla.Core.IPropertyInfo property, bool throwOnFalse)
Returns true if the user is allowed to read the calling property.
override void OnSetChildren(Csla.Serialization.Mobile.SerializationInfo info, Csla.Serialization.Mobile.MobileFormatter formatter)
Override this method to retrieve your child object references from the MobileFormatter serialzation s...
Event arguments for the BusyChanged event.
Contains event data about the changed child object.
Event arguments for an unhandled async exception.
Manages properties and property data for a business object.
bool HasFields
Gets a value indicating whether there are any managed fields available.
List< IPropertyInfo > GetRegisteredProperties()
Returns a copy of the property list for the business object.
FieldDataManager()
Creates an instance of the object.
bool IsDirty()
Returns a value indicating whether any fields are dirty.
IFieldData GetFieldData(IPropertyInfo propertyInfo)
Gets the IFieldData object for a specific field.
bool IsValid()
Returns a value indicating whether all fields are valid.
bool FieldExists(IPropertyInfo propertyInfo)
Returns a value indicating whether an IFieldData entry exists for the specified property.
List< object > GetChildren()
Returns a list of all child objects contained in the list of fields.
IPropertyInfo GetRegisteredProperty(string propertyName)
Returns the IPropertyInfo object corresponding to the property name.
Implements n-level undo capabilities as described in Chapters 2 and 3.
bool BindingEdit
Gets or sets a value indicating whether n-level undo was invoked through IEditableObject.
UndoableBase()
Creates an instance of the object.
Provides information about the DataPortal call.
Maintains metadata about a method.
A strongly-typed resource class, for looking up localized strings, etc.
static string PrivateFieldException
Looks up a localized string similar to Properties with private backing fields must be marked as Relat...
static string NoDeleteRootException
Looks up a localized string similar to Invalid for root objects - use Delete instead.
static string PropertySetNotAllowed
Looks up a localized string similar to Property set not allowed.
static string ChildDeleteException
Looks up a localized string similar to Can not directly mark a child object for deletion - use its pa...
static string PropertyLoadException
Looks up a localized string similar to Property load or set failed for property {0} ({1}).
static string PropertyGetNotAllowed
Looks up a localized string similar to Property get not allowed.
static string BusyObjectsMayNotBeMarkedBusy
Looks up a localized string similar to Objects that are marked busy may not be marked busy again.
static string NoSuchMethod
Looks up a localized string similar to No such method {0}.
Maintains metadata about a property.
virtual T DefaultValue
Gets the default initial value for the property.
RelationshipTypes RelationshipType
Gets the relationship between the declaring object and the object reference in the property.
Type Type
Gets the type of the property.
string Name
Gets the property name value.
Exception indicating a failure to set a property's field.
string Description
Provides access to the description of the broken rule.
A collection of currently broken rules.
BrokenRule GetFirstBrokenRule(Csla.Core.IPropertyInfo property)
Returns the first BrokenRule object corresponding to the specified property.
override string ToString()
Returns the text of all broken rule descriptions, each separated by a Environment....
Manages the list of rules for a business type.
Tracks the business rules for a business object.
static bool HasPermission(AuthorizationActions action, Type objectType)
Checks per-type authorization rules.
List< string > CheckRules()
Invokes all rules for the business type.
override void OnSetChildren(SerializationInfo info, MobileFormatter formatter)
Override this method to retrieve your child object references from the MobileFormatter serialzation s...
async Task< List< string > > CheckRulesAsync(int timeout)
Invokes all rules for the business type.
bool SuppressRuleChecking
Gets or sets a value indicating whether calling CheckRules should result in rule methods being invoke...
bool IsValid
Gets a value indicating whether there are any currently broken rules, which would mean the object is ...
bool CachePermissionResult(AuthorizationActions action, Csla.Core.IMemberInfo element)
Gets a value indicating whether the permission result can be cached.
List< string > CheckObjectRules()
Invokes all rules attached at the class level of the business type.
void AddDataAnnotations()
Adds validation rules corresponding to property data annotation attributes.
bool GetPropertyBusy(Csla.Core.IPropertyInfo property)
Gets a value indicating whether a specific property has any async rules running.
bool RunningAsyncRules
Gets a value indicating whether any async rules are currently executing.
BrokenRulesCollection GetBrokenRules()
Gets the broken rules list.
Object containing the serialization data for a specific object.
object Value
Gets or sets the field value.
This is the core interface implemented by all CSLA .NET base classes.
int Identity
Gets a value representing this object instance's unique identity value within the business object gra...
Defines the common methods for any business object which exposes means to supress and check business ...
Defines the common methods required by all editable CSLA single objects.
Defines the common methods required by all editable CSLA collection objects.
Maintains metadata about a method or property.
string Name
Gets the member name value.
Interface defining an object that notifies when it is busy executing an asynchronous operation.
BusyChangedEventHandler BusyChanged
Event raised when the object's busy status changes.
Implemented by classes that notify when a child object has changed.
EventHandler< ChildChangedEventArgs > ChildChanged
Event indictating that a child object has changed.
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 interface that must be implemented by any business object that contains child objects.
int GetNextIdentity(int current)
Gets and consumes the next available unique identity value for an object instance in the object graph...
void ApplyEditChild(Core.IEditableBusinessObject child)
Override this method to be notified when a child object's Core.BusinessBase.ApplyEdit method has comp...
void RemoveChild(Core.IEditableBusinessObject child)
This method is called by a child object when it wants to be removed from the collection.
IParent Parent
Provide access to the parent reference for use in child object code.
Maintains metadata about a property.
RelationshipTypes RelationshipType
Gets the relationship between the declaring object and the object reference in the property.
Type Type
Gets the type of the property.
object DefaultValue
Gets the default initial value for the property.
Defines the interaction between the rules engine and a business object that hosts the rules.
void RuleComplete(Csla.Core.IPropertyInfo property)
Indicates that a rule has finished processing.
void RuleStart(Csla.Core.IPropertyInfo property)
Indicates that a rule has started processing.
Defines the authorization interface through which an object can indicate which properties the current...
Interface defining callback methods used by the SerializationFormatterFactory.GetFormatter().
void Deserialized()
Method called on an object after deserialization is complete.
delegate void BusyChangedEventHandler(object sender, BusyChangedEventArgs e)
Delegate for handling the BusyChanged event.
StateMode
Indicates the reason the MobileFormatter functionality has been invoked.
AuthorizationActions
Authorization actions.
RelationshipTypes
List of valid relationship types between a parent object and another object through a managed propert...
@ Serializable
Prevents updating or inserting until the transaction is complete.