Esempio n. 1
0
 public virtual bool CanHandleClass(IReflectClass claxx)
 {
     if (_mapHandler.CanHandleClass(claxx))
     {
         return(true);
     }
     return(ReplicationPlatform.IsBuiltinCollectionClass(_reflector, claxx));
 }
Esempio n. 2
0
        private object EmptyClone(IReplicationProviderInside sourceProvider, object obj)
        {
            if (obj == null)
            {
                return(null);
            }
            IReflectClass claxx = ReflectClass(obj);

            if (_reflector.IsValueType(claxx))
            {
                throw new Exception("IllegalState");
            }
            //		if (claxx.isArray()) return arrayClone(obj, claxx, sourceProvider); //Copy arrayClone() from GenericReplicationSession if necessary.
            if (claxx.IsArray())
            {
                throw new Exception("IllegalState");
            }
            //Copy arrayClone() from GenericReplicationSession if necessary.
            if (_collectionHandler.CanHandleClass(claxx))
            {
                return(CollectionClone(sourceProvider, obj, claxx));
            }
            object result = claxx.NewInstance();

            if (result == null)
            {
                throw new Exception("Unable to create a new instance of " + obj.GetType());
            }
            //FIXME Use db4o's standard for throwing exceptions.
            return(result);
        }