コード例 #1
0
            public void Apply(object obj)
            {
                if (obj == null)
                {
                    return;
                }
                IReflectClass claxx = this._enclosing._reflector.ForObject(obj);
                int           level = claxx.IsCollection() ? 3 : 1;

                this._enclosing._container.Activate(obj, level);
            }
コード例 #2
0
ファイル: DataLayerCommon.cs プロジェクト: pondyond/db4o
 public static bool IsCollection(object expandedObj)
 {
     try
     {
         if (expandedObj != null)
         {
             IObjectContainer objectContainer = Db4oClient.Client;
             IReflectClass    refClass        = objectContainer.Ext().Reflector().ForObject(expandedObj);
             return(refClass.IsCollection());
         }
         return(false);
     }
     catch (Exception oEx)
     {
         LoggingHelper.HandleException(oEx);
         return(false);
     }
 }
コード例 #3
0
        private bool CanHold(IReflectClass type)
        {
            if (type == null)
            {
                throw new ArgumentNullException();
            }
            ITypeHandler4 typeHandler = GetHandler();

            if (typeHandler is IQueryableTypeHandler)
            {
                if (((IQueryableTypeHandler)typeHandler).DescendsIntoMembers())
                {
                    return(true);
                }
            }
            IReflectClass classReflector = FieldType().ClassReflector();

            if (classReflector.IsCollection())
            {
                return(true);
            }
            return(classReflector.IsAssignableFrom(type));
        }