コード例 #1
0
 private void BackupProposedValueIfNeeded(DataProperty property, Object oldValue)
 {
     if (_preproposedValuesMap == null)
     {
         _preproposedValuesMap = new BackupValuesMap();
     }
     else
     {
         if (_preproposedValuesMap.ContainsKey(property.Name))
         {
             return;
         }
     }
     _preproposedValuesMap.Add(property.Name, oldValue);
 }
コード例 #2
0
 private void BackupOriginalValueIfNeeded(DataProperty property, Object oldValue)
 {
     if (_originalValuesMap == null)
     {
         _originalValuesMap = new BackupValuesMap();
     }
     else
     {
         if (_originalValuesMap.ContainsKey(property.Name))
         {
             return;
         }
     }
     // reference copy of complex object is deliberate - actual original values will be stored in the co itself.
     _originalValuesMap.Add(property.Name, oldValue);
 }
コード例 #3
0
        internal virtual void RestoreOriginalValues(BackupValuesMap backupMap, EntityVersion version)
        {
            backupMap.ForEach(kvp => {
                var value = kvp.Value;
                if (value is IComplexObject)
                {
                    ((IComplexObject)value).ComplexAspect.RestoreBackupVersion(version);
                }
                var dp = this.StructuralType.GetDataProperty(kvp.Key);

                if (GetValue(dp) != value)
                {
                    SetDpValue(dp, value);
                    OnDataPropertyRestore(dp);
                }
            });
        }
コード例 #4
0
 private ReadOnlyDictionary <String, Object> HandleNull(BackupValuesMap map)
 {
     return((map ?? BackupValuesMap.Empty).ReadOnlyDictionary);
 }