public StartUpDocumentMigrationRunner(
            IMongoMigrationSettings settings,
            ICollectionLocator collectionLocator,
            IDocumentVersionService documentVersionService,
            IDocumentMigrationRunner migrationRunner)
            : this(
                collectionLocator,
                documentVersionService,
                migrationRunner)
        {
            if (settings.ConnectionString == null && settings.Database == null || settings.ClientSettings == null)
            {
                throw new MongoMigrationNoMongoClientException();
            }

            if (settings.ClientSettings != null)
            {
                _client = new MongoClient(settings.ClientSettings);
            }
            else
            {
                _client = new MongoClient(settings.ConnectionString);
            }

            _databaseName = settings.Database;
        }
 private StartUpDocumentMigrationRunner(
     ICollectionLocator collectionLocator,
     IDocumentVersionService documentVersionService,
     IDocumentMigrationRunner migrationRunner)
 {
     _collectionLocator      = collectionLocator;
     _documentVersionService = documentVersionService;
     _migrationRunner        = migrationRunner;
 }
예제 #3
0
        public DocumentVersionsWindowViewModel(IDocumentVersionService documentVersionService, IFileHelper fileHelper, IWindowHelper windowHelper, IMapper mapper)
        {
            this.documentVersionService = documentVersionService;
            this.fileHelper             = fileHelper;
            this.windowHelper           = windowHelper;
            this.mapper = mapper;

            Progresses       = typeof(Progress).GetFields().Select(f => f.GetValue(null).ToString());
            DocumentVersions = new ObservableCollection <DocumentVersionViewModel>();
        }
예제 #4
0
        protected override void OnStartup(StartupEventArgs e)
        {
            DocumentService        = new LocalDocumentService();
            DocumentVersionService = new LocalDocumentVersionService();
            FileHelper             = new FileHelper();
            WindowHelper           = new WindowHelper();
            Mapper = new MapperConfiguration(c => c.AddProfile <MappingProfile>()).CreateMapper();

            var startupWindow = new Views.DocumentsWindow();

            startupWindow.Show();
        }
        public DocumentsWindowViewModel(IDocumentService documentService, IDocumentVersionService documentVersionService, IFileHelper fileHelper, IWindowHelper windowHelper, IMapper mapper)
        {
            this.documentService        = documentService;
            this.documentVersionService = documentVersionService;
            this.fileHelper             = fileHelper;
            this.windowHelper           = windowHelper;
            this.mapper = mapper;

            FilteredDocuments = new ObservableCollection <DocumentViewModel>();

            OnActivated();
        }
        public StartUpDocumentMigrationRunner(
            IMongoClient client,
            IMongoMigrationSettings settings,
            ICollectionLocator collectionLocator,
            IDocumentVersionService documentVersionService,
            IDocumentMigrationRunner migrationRunner)
            : this(
                collectionLocator,
                documentVersionService,
                migrationRunner)
        {
            _client = client;

            if (settings.ConnectionString == null && settings.Database == null)
            {
                return;
            }

            _client       = new MongoClient(settings.ConnectionString);
            _databaseName = settings.Database;
        }
        public void SetUp()
        {
            base.OnSetUp();

            _service = _components.Get <IDocumentVersionService>();
        }
예제 #8
0
 public DocumentMigrationRunner(IMigrationLocator <IDocumentMigration> migrationLocator, IDocumentVersionService documentVersionService)
 {
     _migrationLocator       = migrationLocator;
     _documentVersionService = documentVersionService;
 }
예제 #9
0
 public M001_RenameDorsToDoors(IDocumentVersionService service)
     : base("0.0.1")
 {
     _service = service;
 }
 public MigrationInterceptorFactory(IDocumentMigrationRunner migrationRunner, IDocumentVersionService documentVersionService)
 {
     _migrationRunner        = migrationRunner;
     _documentVersionService = documentVersionService;
 }
 public MigrationInterceptor(IDocumentMigrationRunner migrationRunner, IDocumentVersionService documentVersionService)
     : base(BsonClassMap.LookupClassMap(typeof(TDocument)))
 {
     _migrationRunner        = migrationRunner;
     _documentVersionService = documentVersionService;
 }