public virtual long CollectFor(LocalObjectContainer db, int id, ISlotMap slotMap) { object bigSet = db.GetByID(id); db.Activate(bigSet, 1); BTree btree = (BTree)Reflection4.GetFieldValue(bigSet, "_bTree"); return(FileUsageStatsCollector.BTreeUsage(db, btree, slotMap)); }
public virtual object DeepClone(object context) { TypeHandlerCloneContext typeHandlerCloneContext = (TypeHandlerCloneContext)context; Db4objects.Db4o.Internal.Handlers.Array.ArrayHandler original = (Db4objects.Db4o.Internal.Handlers.Array.ArrayHandler )typeHandlerCloneContext.original; Db4objects.Db4o.Internal.Handlers.Array.ArrayHandler cloned = (Db4objects.Db4o.Internal.Handlers.Array.ArrayHandler )Reflection4.NewInstance(this); cloned._usePrimitiveClassReflector = original._usePrimitiveClassReflector; cloned._handler = typeHandlerCloneContext.CorrectHandlerVersion(original.DelegateTypeHandler ()); return(cloned); }
private void AssertRetrievedItem(IDictionary <string, int> dict) { #if CF Assert.IsFalse(Db().IsActive(dict)); string[] keys = (string[])Reflection4.GetFieldValue(dict, "_keys"); AssertInitalArray(keys, 16); int[] values = (int[])Reflection4.GetFieldValue(dict, "_values"); AssertInitalArray(values, 16); #else Assert.IsNull(Reflection4.GetFieldValue(dict, "_keys")); Assert.IsNull(Reflection4.GetFieldValue(dict, "_values")); #endif Assert.AreEqual(default(int), Reflection4.GetFieldValue(dict, "_size")); }
private void WithCache(IProcedure4 procedure) { IClientSlotCache clientSlotCache = null; try { clientSlotCache = (IClientSlotCache)Reflection4.GetFieldValue(Container(), "_clientSlotCache" ); } catch (ReflectException e) { Assert.Fail("Can't get field _clientSlotCache on container. " + e.ToString()); } procedure.Apply(clientSlotCache); }
public void Visit(FieldValue operand) { operand.Parent().Accept(this); Type clazz = ((operand.Parent() is StaticFieldRoot) ? (Type)_value : _value.GetType ()); try { FieldInfo field = Reflection4.GetField(clazz, operand.FieldName()); _value = field.GetValue(_value); } catch (Exception exc) { // arg is ignored for static Sharpen.Runtime.PrintStackTrace(exc); } }
public virtual object DeepClone(object context) { TypeHandlerCloneContext typeHandlerCloneContext = (TypeHandlerCloneContext)context; StandardReferenceTypeHandler cloned = (StandardReferenceTypeHandler)Reflection4.NewInstance (this); if (typeHandlerCloneContext.original is StandardReferenceTypeHandler) { StandardReferenceTypeHandler original = (StandardReferenceTypeHandler)typeHandlerCloneContext .original; cloned.ClassMetadata(original.ClassMetadata()); } else { // New logic: ClassMetadata takes the responsibility in // #correctHandlerVersion() to set the // ClassMetadata directly on cloned handler. // if(_classMetadata == null){ // throw new IllegalStateException(); // } cloned.ClassMetadata(_classMetadata); } return(cloned); }
/// <exception cref="System.Exception"></exception> protected override void SuiteTearDown() { Reflection4.InvokeStatic(_clazz, TeardownMethodName); }
/// <exception cref="System.Exception"></exception> protected override void SuiteSetUp() { Reflection4.InvokeStatic(_clazz, SetupMethodName); }
private static object GetField(object obj, string fieldName) { return(Reflection4.GetFieldValue(obj, fieldName)); }
private static object FieldValue(object parent, string fieldName) { return((object)Reflection4.GetFieldValue(parent, fieldName)); }
/// <exception cref="System.MemberAccessException"></exception> public static BTree BTree(Db4objects.Db4o.Collections.ISet <BigSetTestCase.Item> set ) { return((BTree)Reflection4.GetFieldValue(set, "_bTree")); }
/// <exception cref="System.MemberAccessException"></exception> public static BTree BTree(Db4o.Collections.ISet <Item> set ) { return((BTree)Reflection4.GetFieldValue(set, "_bTree")); }