示例#1
0
        private IList GetSlots(IFreespaceManager freespaceManager)
        {
            IList retVal = new ArrayList();

            freespaceManager.Traverse(new _IVisitor4_110(retVal));
            return(retVal);
        }
        protected virtual void GrafittiFreeSpace()
        {
            if (!(Db() is IoAdaptedObjectContainer))
            {
                return;
            }
            IoAdaptedObjectContainer file = ((IoAdaptedObjectContainer)Db());
            IFreespaceManager        fm   = file.FreespaceManager();

            fm.Traverse(new _IVisitor4_60(file));
        }
        private void AssertMonitoredFreespaceIsCorrect()
        {
            IFreespaceManager        freespaceManager = FileSession().FreespaceManager();
            FreespaceCountingVisitor visitor          = new FreespaceCountingVisitor();

            freespaceManager.Traverse(visitor);
            int freespace       = visitor.TotalFreespace;
            int slotCount       = visitor.SlotCount;
            int averageSlotSize = slotCount == 0 ? 0 : freespace / slotCount;

            Assert.AreEqual(freespace, TotalFreespace());
            Assert.AreEqual(slotCount, SlotCount());
            Assert.AreEqual(averageSlotSize, AverageSlotSize());
        }
示例#4
0
        public void Apply(IInternalObjectContainer container)
        {
            if (!(container is LocalObjectContainer) || container.ConfigImpl.IsReadOnly())
            {
                return;
            }
            LocalObjectContainer localObjectContainer = (LocalObjectContainer)container;
            IFreespaceManager    freespaceManager     = localObjectContainer.FreespaceManager();
            FreespaceListener    freespaceListener    = new FreespaceListener(localObjectContainer);

            freespaceManager.Traverse(new FreespaceInitializingVisitor(freespaceListener));

            IEventRegistry eventRegistry = EventRegistryFactory.ForObjectContainer(container);

            eventRegistry.Closing += delegate
            {
                freespaceListener.Dispose();
                freespaceManager.Listener(NullFreespaceListener.Instance);
            };

            freespaceManager.Listener(freespaceListener);
        }
 private IList GetSlots(IFreespaceManager freespaceManager)
 {
     IList retVal = new ArrayList();
     freespaceManager.Traverse(new _IVisitor4_110(retVal));
     return retVal;
 }
 public virtual void Traverse(IVisitor4 visitor)
 {
     _delegate.Traverse(new _IVisitor4_89(this, visitor));
 }