Ejemplo n.º 1
0
 /// <summary>
 ///   This method is used to store the object : natibe or non native and return a number : - The position of the object if it is a native object - The oid (as a negative number) if it is a non native object
 /// </summary>
 /// <param name="aoi"> </param>
 /// <returns> </returns>
 /// <exception cref="System.Exception">System.Exception</exception>
 private long InternalStoreObjectWrapper(AbstractObjectInfo aoi)
 {
     if (aoi.IsNative())
         return InternalStoreObject((NativeObjectInfo) aoi);
     if (aoi.IsNonNativeObject())
     {
         var oid = StoreObject(null, (NonNativeObjectInfo) aoi);
         return -oid.ObjectId;
     }
     // Object references are references to object already stored.
     // But in the case of map, the reference can appear before the real
     // object (as order may change)
     // If objectReference.getOid() is null, it is the case. In this case,
     // We take the object being referenced and stores it directly.
     var objectReference = (ObjectReference) aoi;
     if (objectReference.GetOid() == null)
     {
         var oid = StoreObject(null, objectReference.GetNnoi());
         return -oid.ObjectId;
     }
     return -objectReference.GetOid().ObjectId;
 }