public string Label()
        {
            ObjectByRef label = new ObjectByRef();

            RunDecorated(new _IRunnable_26(this, label));
            return((string)label.value);
        }
Exemplo n.º 2
0
        public Msg ReplyFromServer()
        {
            Unmarshall(_payLoad._offset);
            var result = new ObjectByRef();

            Container().WithTransaction(Transaction(), new _IRunnable_15(this, result));
            return((Msg)result.value);
        }
Exemplo n.º 3
0
        public virtual void TestTransactionInEventArgs()
        {
            var factory    = EventRegistryFactory.ForObjectContainer(Db());
            var called     = new BooleanByRef();
            var foundTrans = new ObjectByRef();

            factory.Creating += new _IEventListener4_20(called, foundTrans).OnEvent;
            Db().Store(new Item());
            Db().Commit();
            Assert.IsTrue(called.value);
            Assert.AreSame(Trans(), foundTrans.value);
        }
        public virtual void TestTransactionInEventArgs()
        {
            IEventRegistry factory    = EventRegistryFactory.ForObjectContainer(Db());
            BooleanByRef   called     = new BooleanByRef();
            ObjectByRef    foundTrans = new ObjectByRef();

            factory.Creating += new System.EventHandler <Db4objects.Db4o.Events.CancellableObjectEventArgs>
                                    (new _IEventListener4_20(called, foundTrans).OnEvent);
            Db().Store(new EventArgsTransactionTestCase.Item());
            Db().Commit();
            Assert.IsTrue(called.value);
            Assert.AreSame(Trans(), foundTrans.value);
        }
Exemplo n.º 5
0
        // override on demand to check queries
        protected virtual int[] CastToIntArray(object obj)
        {
            var byRef = new ObjectByRef(obj);

            return((int[])byRef.value);
        }
 public _IEventListener4_20(BooleanByRef called, ObjectByRef foundTrans)
 {
     this.called     = called;
     this.foundTrans = foundTrans;
 }
 public _IRunnable_26(TestWithFixture _enclosing, ObjectByRef label)
 {
     this._enclosing = _enclosing;
     this.label      = label;
 }
Exemplo n.º 8
0
 public _IRunnable_15(MQueryExecute _enclosing, ObjectByRef result)
 {
     this._enclosing = _enclosing;
     this.result     = result;
 }
Exemplo n.º 9
0
        // Bug when reading old format:
        // Null wrappers are converted to Character.MAX_VALUE
        private char[] CastToCharArray(object obj)
        {
            var byRef = new ObjectByRef(obj);

            return((char[])byRef.value);
        }