示例#1
0
 private void AssertHasIndex()
 {
     if (!HasIndex())
     {
         Exceptions4.ThrowRuntimeException(Db4objects.Db4o.Internal.Messages.OnlyForIndexedFields
                                           );
     }
 }
示例#2
0
 private void AssertHasIndex()
 {
     if (!HasIndex())
     {
         Exceptions4.ThrowRuntimeException(Messages.OnlyForIndexedFields
                                           );
     }
 }
示例#3
0
 public override void ReadBytes(byte[] bytes, int address, int length)
 {
     try
     {
         _memoryBin.Read(address, bytes, length);
     }
     catch (Exception e)
     {
         Exceptions4.ThrowRuntimeException(13, e);
     }
 }
示例#4
0
 public void ReflectWith(IReflector reflect)
 {
     if (_container != null)
     {
         Exceptions4.ThrowRuntimeException(46);
     }
     // see readable message for code in Messages.java
     if (reflect == null)
     {
         throw new ArgumentNullException();
     }
     _config.Put(ConfiguredReflectorKey, reflect);
     _config.Put(ReflectorKey, null);
 }
示例#5
0
        // FIXME: needs test case
        public virtual void Rename(string newName)
        {
            ObjectContainerBase container = Container();

            if (!container.IsClient)
            {
                _name = newName;
                _containingClass.SetStateDirty();
                _containingClass.Write(container.SystemTransaction());
            }
            else
            {
                Exceptions4.ThrowRuntimeException(58);
            }
        }
示例#6
0
 /// <summary>Will raise an exception if argument class doesn't match this class - violates equals() contract in favor of failing fast.
 ///     </summary>
 /// <remarks>Will raise an exception if argument class doesn't match this class - violates equals() contract in favor of failing fast.
 ///     </remarks>
 public override bool Equals(object obj)
 {
     if (this == obj)
     {
         return(true);
     }
     if (null == obj)
     {
         return(false);
     }
     if (GetType() != obj.GetType())
     {
         Exceptions4.ShouldNeverHappen();
     }
     return(GetName().Equals(((Db4objects.Db4o.Internal.Config4Abstract)obj).GetName()
                             ));
 }
示例#7
0
        public void TraverseValues(Transaction transaction, IVisitor4 userVisitor)
        {
            if (!Alive())
            {
                return;
            }
            AssertHasIndex();
            ObjectContainerBase stream = transaction.Container();

            if (stream.IsClient)
            {
                Exceptions4.ThrowRuntimeException(Db4objects.Db4o.Internal.Messages.ClientServerUnsupported
                                                  );
            }
            lock (stream.Lock())
            {
                IContext context = transaction.Context();
                _index.TraverseKeys(transaction, new _IVisitor4_861(this, userVisitor, context));
            }
        }
示例#8
0
 public virtual int OwnLength()
 {
     throw Exceptions4.ShouldNeverBeCalled();
 }