コード例 #1
0
ファイル: ArchiveModelManager.cs プロジェクト: tom-arrow/osu
        protected ArchiveModelManager(Storage storage, IDatabaseContextFactory contextFactory, MutableDatabaseBackedStore <TModel> modelStore, IIpcHost importHost = null)
        {
            ContextFactory = contextFactory;

            ModelStore              = modelStore;
            ModelStore.ItemAdded   += s => handleEvent(() => ItemAdded?.Invoke(s));
            ModelStore.ItemRemoved += s => handleEvent(() => ItemRemoved?.Invoke(s));

            Files = new FileStore(contextFactory, storage);

            if (importHost != null)
            {
                ipc = new ArchiveImportIPCChannel(importHost, this);
            }

            ModelStore.Cleanup();
        }
コード例 #2
0
        protected ArchiveModelManager(Storage storage, IDatabaseContextFactory contextFactory, MutableDatabaseBackedStoreWithFileIncludes <TModel, TFileModel> modelStore, IIpcHost importHost = null)
        {
            ContextFactory = contextFactory;

            ModelStore              = modelStore;
            ModelStore.ItemAdded   += item => handleEvent(() => itemAdded.Value = new WeakReference <TModel>(item));
            ModelStore.ItemRemoved += item => handleEvent(() => itemRemoved.Value = new WeakReference <TModel>(item));

            Files = new FileStore(contextFactory, storage);

            if (importHost != null)
            {
                ipc = new ArchiveImportIPCChannel(importHost, this);
            }

            ModelStore.Cleanup();
        }
コード例 #3
0
        protected ArchiveModelManager(Storage storage, IDatabaseContextFactory contextFactory, MutableDatabaseBackedStoreWithFileIncludes <TModel, TFileModel> modelStore, IIpcHost importHost = null)
        {
            ContextFactory = contextFactory;

            ModelStore              = modelStore;
            ModelStore.ItemUpdated += item => handleEvent(() => ItemUpdated?.Invoke(item));
            ModelStore.ItemRemoved += item => handleEvent(() => ItemRemoved?.Invoke(item));

            exportStorage = storage.GetStorageForDirectory(@"exports");

            Files = new FileStore(contextFactory, storage);

            if (importHost != null)
            {
                ipc = new ArchiveImportIPCChannel(importHost, this);
            }

            ModelStore.Cleanup();
        }