Ejemplo n.º 1
0
 internal QConClass(Transaction trans, QCon parent, QField field, IReflectClass claxx
                    ) : base(trans, parent, field, null)
 {
     // C/S
     if (claxx != null)
     {
         ObjectContainerBase container = trans.Container();
         _classMetadata = container.ClassMetadataForReflectClass(claxx);
         if (_classMetadata == null)
         {
             // could be an aliased class, try to resolve.
             string className        = claxx.GetName();
             string aliasRunTimeName = container.Config().ResolveAliasStoredName(className);
             if (!className.Equals(aliasRunTimeName))
             {
                 _classMetadata = container.ClassMetadataForName(aliasRunTimeName);
             }
         }
         if (claxx.Equals(container._handlers.IclassObject))
         {
             _classMetadata = (ClassMetadata)_classMetadata.TypeHandler();
         }
     }
     _claxx = claxx;
 }
Ejemplo n.º 2
0
        internal override bool Evaluate(IInternalCandidate candidate)
        {
            bool        result      = true;
            QCandidates qCandidates = candidate.Candidates();

            if (qCandidates.IsTopLevel() && qCandidates.WasLoadedFromClassFieldIndex())
            {
                if (_classMetadata.GetAncestor() != null)
                {
                    BTreeClassIndexStrategy index = (BTreeClassIndexStrategy)_classMetadata.Index();
                    if (index == null)
                    {
                        return(i_evaluator.Not(true));
                    }
                    BTree  btree        = index.Btree();
                    object searchResult = btree.Search(candidate.Transaction(), candidate.Id());
                    result = searchResult != null;
                }
            }
            else
            {
                IReflectClass claxx = candidate.ClassMetadata().ClassReflector();
                if (claxx == null)
                {
                    result = false;
                }
                else
                {
                    result = i_equal ? _claxx.Equals(claxx) : _claxx.IsAssignableFrom(claxx);
                }
            }
            return(i_evaluator.Not(result));
        }
Ejemplo n.º 3
0
		internal QConClass(Transaction trans, QCon parent, QField field, IReflectClass claxx
			) : base(trans, parent, field, null)
		{
			// C/S
			if (claxx != null)
			{
				ObjectContainerBase container = trans.Container();
				_classMetadata = container.ClassMetadataForReflectClass(claxx);
				if (_classMetadata == null)
				{
					// could be an aliased class, try to resolve.
					string className = claxx.GetName();
					string aliasRunTimeName = container.Config().ResolveAliasStoredName(className);
					if (!className.Equals(aliasRunTimeName))
					{
						_classMetadata = container.ClassMetadataForName(aliasRunTimeName);
					}
				}
				if (claxx.Equals(container._handlers.IclassObject))
				{
					_classMetadata = (ClassMetadata)_classMetadata.TypeHandler();
				}
			}
			_claxx = claxx;
		}
Ejemplo n.º 4
0
 internal QConClass(Transaction a_trans, QCon a_parent, QField a_field, IReflectClass
                    claxx) : base(a_trans, a_parent, a_field, null)
 {
     // C/S
     if (claxx != null)
     {
         _classMetadata = a_trans.Container().ProduceClassMetadata(claxx);
         if (claxx.Equals(a_trans.Container()._handlers.IclassObject))
         {
             _classMetadata = (ClassMetadata)_classMetadata.TypeHandler();
         }
     }
     _claxx = claxx;
 }
Ejemplo n.º 5
0
		internal QConClass(Transaction a_trans, QCon a_parent, QField a_field, IReflectClass
			 claxx) : base(a_trans, a_parent, a_field, null)
		{
			// C/S
			if (claxx != null)
			{
				_classMetadata = a_trans.Container().ProduceClassMetadata(claxx);
				if (claxx.Equals(a_trans.Container()._handlers.IclassObject))
				{
					_classMetadata = (ClassMetadata)_classMetadata.TypeHandler();
				}
			}
			_claxx = claxx;
		}
Ejemplo n.º 6
0
        internal override bool Evaluate(QCandidate a_candidate)
        {
            bool          res   = true;
            IReflectClass claxx = a_candidate.ClassReflector();

            if (claxx == null)
            {
                res = false;
            }
            else
            {
                res = i_equal ? _claxx.Equals(claxx) : _claxx.IsAssignableFrom(claxx);
            }
            return(i_evaluator.Not(res));
        }
        internal bool CreateClassMetadata(ClassMetadata clazz, IReflectClass reflectClazz
                                          )
        {
            bool result = false;

            _classMetadataCreationDepth++;
            try
            {
                IReflectClass parentReflectClazz = reflectClazz.GetSuperclass();
                ClassMetadata parentClazz        = null;
                if (parentReflectClazz != null && !parentReflectClazz.Equals(Container()._handlers
                                                                             .IclassObject))
                {
                    parentClazz = ProduceClassMetadata(parentReflectClazz);
                }
                result = Container().CreateClassMetadata(clazz, reflectClazz, parentClazz);
            }
            finally
            {
                _classMetadataCreationDepth--;
            }
            InitClassMetadataOnUp();
            return(result);
        }
Ejemplo n.º 8
0
 private bool IsTheObjectClass(IReflectClass claxx)
 {
     return(claxx.Equals(Stream()._handlers.IclassObject));
 }
Ejemplo n.º 9
0
 private bool IsTheObjectClass(IReflectClass claxx)
 {
     return claxx.Equals(Stream()._handlers.IclassObject);
 }
Ejemplo n.º 10
0
 public bool Match(IReflectClass classReflector)
 {
     return(itemClass.Equals(classReflector));
 }