/// <summary>
 /// Sets up the object after loading. In this case:
 /// 1. Sets the status of the object to not new, not dirty, not editing and not deleted.
 /// 2. Calls the <see cref="BusinessObject.AfterLoad()"/> method on the object
 /// 3. Backs up the property values, setting the persisted values of the properties
 /// </summary>
 /// <param name="bo">The object to configure</param>
 /// <returns>The business object to add to the <see cref="DataStoreInMemory"/></returns>
 protected virtual IBusinessObject ConfigureObjectAfterLoad(IBusinessObject bo)
 {
     BusinessObjectLoaderBase.SetStatusAfterLoad(bo);
     BusinessObjectLoaderBase.CallAfterLoad(bo);
     bo.Props.BackupPropertyValues();
     return(bo);
 }
Пример #2
0
 private static void ConfigureNewBo(IBusinessObject bo)
 {
     BusinessObjectLoaderBase.CallAfterLoad(bo);
     try
     {
         BusinessObjectManager.Instance.Add(bo);
     }
     catch (HabaneroDeveloperException ex)
     {
         // object already exists - this is a possible circumstance so we can let it go
         if (!ex.DeveloperMessage.Contains("Two copies of the business object"))
         {
             throw;
         }
     }
     bo.Props.BackupPropertyValues();
 }