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; } }
// 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()]); }
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()]); }
public static object[] ToArray(IEnumerator tests, IArrayFactory factory) { Collection4 elements = new Collection4(tests); return(elements.ToArray(factory.NewArray(elements.Size()))); }
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; }
private StaticField[] ToStaticFieldArray(Collection4 fields) { return (StaticField[]) fields.ToArray(new StaticField[fields.Size()]); }
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; } }
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; }
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())." ); } } }