示例#1
0
        void IRepositoryWriter.Close()
        {
            // Create the catalogue writer that will be written to.

            ICatalogueWriter writer = StartWriting();

            // Write out all elements.

            foreach (Namespace ns in _namespaces.Values)
            {
                writer.Write(ns);
            }
            foreach (Source source in _sources.Values)
            {
                writer.Write(source);
            }
            foreach (EventType eventType in _events.Values)
            {
                writer.Write(eventType);
            }

            // Stop the writing so that everything can be written to the repository.

            StopWriting();

            _namespaces = new SortedList();
            _sources    = new SortedList();
            _events     = new SortedList();
        }
示例#2
0
 protected CatalogueBase(
     List <TCatalogueItem> list,
     ICatalogueExporter <TCatalogueItem> catalogueExporter,
     ICatalogueImporter <TCatalogueItem> catalogueImporter,
     ICatalogueReader <TCatalogueItem> catalogueReader,
     ICatalogueWriter <TCatalogueItem> catalogueWriter)
 {
     _list = list;
     _catalogueExporter = catalogueExporter ?? throw new ArgumentNullException(nameof(catalogueExporter));
     _catalogueImporter = catalogueImporter ?? throw new ArgumentNullException(nameof(catalogueImporter));
     _catalogueReader   = catalogueReader ?? throw new ArgumentNullException(nameof(catalogueReader));
     _catalogueWriter   = catalogueWriter ?? throw new ArgumentNullException(nameof(catalogueWriter));
 }