Exemplo n.º 1
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);
        }
 public virtual void Listener(IFreespaceListener listener)
 {
     _delegate.Listener(listener);
 }