public virtual IConstraint[] ToArray()
		{
			lock (_cluster)
			{
				Collection4 all = new Collection4();
				for (int i = 0; i < _constraints.Length; i++)
				{
					ClusterConstraint c = (ClusterConstraint)_constraints[i];
					for (int j = 0; j < c._constraints.Length; j++)
					{
						all.Add(c._constraints[j]);
					}
				}
				IConstraint[] res = new IConstraint[all.Size()];
				all.ToArray(res);
				return res;
			}
		}
Esempio n. 2
0
		// Simple
		// Collection
		// Complex
		// General
		//regression
		protected virtual Type[] Concat(Type[] x, Type[] y)
		{
			Collection4 c = new Collection4(x);
			c.AddAll(y);
			return (Type[])c.ToArray(new Type[c.Size()]);
		}
Esempio n. 3
0
		public static object[] ToArray(IEnumerator tests, IArrayFactory factory)
		{
			Collection4 elements = new Collection4(tests);
			return elements.ToArray(factory.NewArray(elements.Size()));
		}
		public virtual IReflectClass[] Collect()
		{
			Collection4 classes = new Collection4();
			CollectKnownClasses(classes);
			return (IReflectClass[])classes.ToArray(new IReflectClass[classes.Size()]);
		}
Esempio n. 5
0
        public static object[] ToArray(IEnumerator tests, IArrayFactory factory)
        {
            Collection4 elements = new Collection4(tests);

            return(elements.ToArray(factory.NewArray(elements.Size())));
        }
Esempio n. 6
0
 private ClassAspect[] ToClassAspectArray(Collection4 aspects)
 {
     var array = new ClassAspect[aspects.Size()];
     aspects.ToArray(array);
     for (var i = 0; i < array.Length; i++)
     {
         array[i].SetHandle(i);
     }
     return array;
 }
Esempio n. 7
0
 private StaticField[] ToStaticFieldArray(Collection4 fields)
 {
     return (StaticField[]) fields.ToArray(new StaticField[fields.Size()]);
 }
Esempio n. 8
0
 public virtual IStoredField[] GetStoredFields()
 {
     lock (Lock())
     {
         if (_aspects == null)
         {
             return new IStoredField[0];
         }
         var storedFields = new Collection4();
         TraverseDeclaredFields(new _IProcedure4_1039(storedFields));
         var fields = new IStoredField[storedFields.Size()];
         storedFields.ToArray(fields);
         return fields;
     }
 }
Esempio n. 9
0
 internal virtual IConstraint ToConstraint(Collection4 constraints)
 {
     if (constraints.Size() == 1)
     {
         return (IConstraint) constraints.SingleElement();
     }
     if (constraints.Size() > 0)
     {
         var constraintArray = new IConstraint[constraints.Size()];
         constraints.ToArray(constraintArray);
         return new QConstraints(_trans, constraintArray);
     }
     return null;
 }
Esempio n. 10
0
		private void ValidateTranslatorAspects(Collection4 aspects)
		{
			if (HasIncompatibleTranslatorAspect(aspects))
			{
				if (!ConfigImpl().RecoveryMode())
				{
					string newLine = Runtime.GetProperty("line.separator");
					throw new Db4oFatalException("Class " + GetName() + " was used with and without translators configured. Found aspects:"
						 + newLine + Arrays4.ToString(aspects.ToArray()) + newLine + "No changes were made to the database. "
						 + newLine + "If you want to run with this configuration you can configure recovery mode (see FileConfiguration#recoveryMode())."
						);
				}
			}
		}