public LoadAndSaveProjectCommand(
     Func <IProjectManager> projectManagerFactory,
     Func <IProjectFileService> projectFileServiceFactory)
 {
     _projectManager     = projectManagerFactory();
     _projectFileService = projectFileServiceFactory();
 }
 /// <summary>
 /// Creates a new instance of <see cref="OpenProjectCommand"/>
 /// </summary>
 /// <param name="projectFileServiceFactory">Factory to get an instance of an <see cref="IProjectFileService"/>.</param>
 /// <param name="projectManagerFactory">Factory to get an instance of an <see cref="IProjectManager"/>.</param>
 /// <param name="projectScreenFactory">Factory to get an instance of an <see cref="ProjectScreen"/>.</param>
 /// <param name="screenHostFactory">Factory to get an instance of an <see cref="ScreenHostBase"/>.</param>
 public OpenProjectCommand(
     Func <IProjectFileService> projectFileServiceFactory,
     Func <IProjectManager> projectManagerFactory,
     Func <ProjectScreen> projectScreenFactory,
     Func <ScreenHostBase> screenHostFactory)
 {
     _projectFileService = projectFileServiceFactory();
     _projectManager     = projectManagerFactory();
     _projectScreen      = projectScreenFactory();
     _screenHost         = screenHostFactory();
 }
Esempio n. 3
0
 public ProjectManager(
     Func <IProjectFileService> projectFileServiceFactory,
     Func <ILibraryManager> libraryManagerFactory,
     Func <DiagramFactory> diagramViewModelFactoryFactory)
 {
     Diagrams                       = new List <Diagram.Diagram>();
     _libraryManager                = libraryManagerFactory.Invoke();
     _projectFileService            = projectFileServiceFactory.Invoke();
     _diagramViewModelFactory       = diagramViewModelFactoryFactory.Invoke();
     DiagramCallNode.ProjectManager = this;
     CurrentProjectChanged         += OnCurrentProjectChanged;
 }
Esempio n. 4
0
 /// <summary>
 /// Creates a new instance of <see cref="OpenProjectCommand"/>
 /// </summary>
 /// <param name="projectFileServiceFactory">Factory to get an instance of an <see cref="IProjectFileService"/>.</param>
 /// <param name="projectManagerFactory">Factory to get an instance of an <see cref="IProjectManager"/>.</param>
 /// <param name="projectScreenFactory">Factory to get an instance of an <see cref="ProjectScreen"/>.</param>
 /// <param name="screenHostFactory">Factory to get an instance of an <see cref="ScreenHostBase"/>.</param>
 public OpenTemplateCommand(
     Func <IProjectFileService> projectFileServiceFactory,
     Func <IProjectManager> projectManagerFactory,
     Func <ProjectScreen> projectScreenFactory,
     Func <ScreenHostBase> screenHostFactory)
 {
     _projectFileService = projectFileServiceFactory();
     _projectFileService.DirectoryToService = ProjectFileService.TemplatesSaveDirectoryPath;
     _projectManager = projectManagerFactory();
     _projectScreen  = projectScreenFactory();
     _screenHost     = screenHostFactory();
 }
Esempio n. 5
0
        private async Task GetCurrentProject_ShouldReturnNull()
        {
            var context = ContextInitializer.InitializeContext();

            await this.SeedData(context);

            var cloudinary = new Mock <CloudinaryService>().Object;

            this.projectFileService = new ProjectFileService(cloudinary, context);

            var result = await this.projectFileService.GetCurrentProjectFile("ab3bd817-98cd-4cf3-a80a-53ea0cd9c200");

            Assert.Null(result);
        }
Esempio n. 6
0
        private async Task GetCurrentProject_ShouldWorkFine()
        {
            var context = ContextInitializer.InitializeContext();

            await this.SeedData(context);

            var cloudinary = new Mock <CloudinaryService>().Object;

            this.projectFileService = new ProjectFileService(cloudinary, context);

            var result = await this.projectFileService.GetCurrentProjectFile("ab2bd817-98cd-4cf3-a80a-53ea0cd9c200");

            Assert.Equal("TestProjectFile.jpg", result.Name);
            Assert.True(result.IsPublic);
            Assert.False(result.IsApproved);
        }
 /// <summary>
 /// Creates a new instance of <see cref="ProjectManager"/>.
 /// </summary>
 /// <param name="dialogHostFactory">A factory that returns a <see cref="DialogHostBase"/>.</param>
 /// <param name="diagramFactoryFactory">A factory that returns an <see cref="DiagramFactory"/>.</param>
 /// <param name="libraryManagerFactory">A factory that returns an <see cref="ILibraryManager"/>.</param>
 /// <param name="projectFileServiceFactory">A factory that returns a <see cref="IProjectFileService"/>.</param>
 /// <param name="nodeServiceProviderFactory">A factory that returns a <see cref="NodeServiceProvider"/>.</param>
 public ProjectManager(
     Func <DialogHostBase> dialogHostFactory,
     Func <DiagramFactory> diagramFactoryFactory,
     Func <ILibraryManager> libraryManagerFactory,
     Func <IProjectFileService> projectFileServiceFactory,
     Func <ITransactor> transactorFactory,
     Func <NodeServiceProvider> nodeServiceProviderFactory)
 {
     _dialogHost          = dialogHostFactory();
     _libraryManager      = libraryManagerFactory();
     _projectFileService  = projectFileServiceFactory();
     _transactor          = transactorFactory();
     _diagramFactory      = diagramFactoryFactory();
     _nodeServiceProvider = nodeServiceProviderFactory();
     _nodeServiceProvider.RegisterService <IProjectManager>(this);
     _transactor.Transacted += DirtyProject;
 }
        public VisualDropStartScreenViewModel(Func <IProjectFileService> projectFileServiceFactory)
        {
            _projectFileService = projectFileServiceFactory.Invoke();
            _projectFileService.ProjectSaved += ProjectSavedHandler;
            PopulateTargetSpectrumValues();

            for (int i = 0; i < _targetSpectrumLogoValues.Count; i++)
            {
                SpectrumLogoValues.Add(_targetSpectrumLogoValues[i]);
            }

            GenerateAnimationFrames();

            RecentProject1 = Properties.Settings.Default.RecentProject1;
            RecentProject2 = Properties.Settings.Default.RecentProject2;
            RecentProject3 = Properties.Settings.Default.RecentProject3;
            RecentProject1 = string.IsNullOrWhiteSpace(RecentProject1) ? "Recent #1" : RecentProject1;
            RecentProject2 = string.IsNullOrWhiteSpace(RecentProject2) ? "Recent #2" : RecentProject2;
            RecentProject3 = string.IsNullOrWhiteSpace(RecentProject3) ? "Recent #3" : RecentProject3;
            UpdateRecentProjects(string.Empty);
        }
 public ProjectFileController(IProjectFileService projectFileService, IAdminService adminService)
 {
     this.projectFileService = projectFileService;
     this.adminService       = adminService;
 }
Esempio n. 10
0
 public ProjectFileController(IProjectFileService projectfileService)
 {
     this.projectfileService = projectfileService;
 }
Esempio n. 11
0
 public OpenProjectCommand(Func <IProjectFileService> projectFileServiceFactory, Func <IProjectManager> projectManagerFactory, Func <ProjectScreen> projectScreenViewModelFactory)
 {
     _projectFileService = projectFileServiceFactory.Invoke();
     _projectManager     = projectManagerFactory.Invoke();
     _projectScreen      = projectScreenViewModelFactory.Invoke();
 }
Esempio n. 12
0
 public SolutionFileService(IFileSystem fileSystem, IProjectFileService projectFileService)
 {
     _fileSystem         = fileSystem;
     _projectFileService = projectFileService;
 }
Esempio n. 13
0
 public StartScreenViewModel(Func <IProjectManager> projectManagerFactory, Func <IProjectFileService> projectFileServiceFactory)
 {
     _projectFileService = projectFileServiceFactory.Invoke();
     _projectManager     = projectManagerFactory.Invoke();
 }
Esempio n. 14
0
 public ProjectFileController(IProjectFileService iProjectFileService, IUnitOfWork unitOfWork, IUserInfo userInfo)
 {
     _iProjectFileService = iProjectFileService;
     _unitOfWork = unitOfWork;
     _userInfo = userInfo;
 }
Esempio n. 15
0
 public ProjectFileController(IProjectFileService iProjectFileService, IUnitOfWork unitOfWork, IUserInfo userInfo)
 {
     _iProjectFileService = iProjectFileService;
     _unitOfWork          = unitOfWork;
     _userInfo            = userInfo;
 }