Пример #1
0
 public ProjectSync(string projectPath, Targets target, IConsole console, IProjectFactory factory)
 {
     _projectPath = projectPath;
     _target = target;
     _console = console;
     _factory = factory;
 }
        public void GetTargetFramework(string targetFramework, string targetFrameworkIdentifier, string targetFrameworkVersion, string targetFrameworkProfile, string expectedTargetFramework)
        {
            var properties = new Dictionary <string, string>();

            if (targetFramework != null)
            {
                properties.Add("TargetFramework", targetFramework);
            }
            if (targetFrameworkIdentifier != null)
            {
                properties.Add("TargetFrameworkIdentifier", targetFrameworkIdentifier);
            }
            if (targetFrameworkVersion != null)
            {
                properties.Add("TargetFrameworkVersion", targetFrameworkVersion);
            }
            if (targetFrameworkProfile != null)
            {
                properties.Add("TargetFrameworkProfile", targetFrameworkProfile);
            }

            var project = IProjectFactory.Create(properties);
            var actualTargetFramework = ProjectExtensions.GetTargetFramework(project);

            Assert.Equal(expectedTargetFramework, actualTargetFramework);
        }
Пример #3
0
        public void PropertiesDiff_GetLines()
        {
            var defaultedProps = IProjectFactory.Create("A=B;C=D").Properties.ToImmutableArray();
            var removedProps   = IProjectFactory.Create("E=F;G=H").Properties.ToImmutableArray();
            var changedProps   = IProjectFactory.Create("I=J").Properties.Zip(IProjectFactory.Create("I=K").Properties, (a, b) => (a, b)).ToImmutableArray();
            var diff           = new PropertiesDiff(defaultedProps, removedProps, changedProps);

            var lines         = diff.GetDiffLines();
            var expectedLines = new[]
            {
                "Properties that are defaulted by the SDK:",
                "- A = B",
                "- C = D",
                "",
                "Properties that are not defaulted by the SDK:",
                "+ E = F",
                "+ G = H",
                "",
                "Properties whose value is different from the SDK's default:",
                "- I = J",
                "+ I = K",
                ""
            };

            Assert.Equal(expectedLines, lines);
        }
Пример #4
0
 public ProjectService(IProjectRepository repository, IMapper mapper, ILogger <ProjectDTO> logger, IProjectFactory factory)
 {
     _repository = repository;
     _mapper     = mapper;
     _logger     = logger;
     _factory    = factory;
 }
Пример #5
0
 public ClassViewProject(IProjectFactory factory, IServiceProvider serviceProvider)
     : base(factory, serviceProvider)
 {
     this._rootItem = new ClassBrowserProjectItem(this);
     this._projectData = new ClassViewProjectData();
     this._projectData.Load(serviceProvider);
 }
Пример #6
0
        public ViewController(
            ISessionFactory sessionFactory,
            IProjectFactory projectFactory,
            IIbtFileParser telemetryFileParser,
            IOptionsMonitor <iRacingTelemetryOptions> optionsAccessor,
            ILog log,
            IServiceProvider serviceProvider,
            IDisplayInfoService displayInfoService)
        {
            _serviceProvider = serviceProvider;

            _sessionFactory      = (sessionFactory == null) ? throw new ArgumentNullException(nameof(sessionFactory)) : sessionFactory;
            _projectFactory      = (projectFactory == null) ? throw new ArgumentNullException(nameof(projectFactory)) : projectFactory;
            _displayInfoService  = (displayInfoService == null) ? throw new ArgumentNullException(nameof(displayInfoService)) : displayInfoService;
            _telemetryFileParser = (telemetryFileParser == null) ? throw new ArgumentNullException(nameof(telemetryFileParser)) : telemetryFileParser;

            _options = (optionsAccessor == null) ? throw new ArgumentNullException(nameof(optionsAccessor)) : optionsAccessor.CurrentValue;
            Log      = (log == null) ? throw new ArgumentNullException(nameof(log)) : log;

            MdiChildren = new ObservableCollection <IMdiChildForm>();
            MdiChildren.CollectionChanged += MdiChildren_CollectionChanged;

            PropertyChanged += TelemetryViewController_PropertyChanged;
            ProjectClosing  += TelemetryViewController_ProjectClosing;

            Task.Run(async() =>
            {
                await LoadFieldDefinitionsAsync();
                FieldDefinitions.CollectionChanged += FieldDefinitions_CollectionChanged;

                await LoadFieldDisplayInfos();
                FieldDisplayInfos.CollectionChanged += FieldDisplayInfos_CollectionChanged;
            });
        }
Пример #7
0
        /// <summary>
        /// Creates a new instance of the <see cref="XContainer"/> class.
        /// </summary>
        /// <param name="factory">The project factory.</param>
        /// <param name="project">The new container owner project.</param>
        /// <param name="name">The new container name.</param>
        /// <returns>The new instance of the <see cref="XContainer"/>.</returns>
        private XContainer CreateGridTemplate(IProjectFactory factory, XProject project, string name)
        {
            var template = factory.GetTemplate(project, name);

            var style = project
                        .StyleLibraries.FirstOrDefault(g => g.Name == "Template")
                        .Items.FirstOrDefault(s => s.Name == "Grid");
            var layer   = template.Layers.FirstOrDefault();
            var builder = layer.Shapes.ToBuilder();
            var grid    = XRectangle.Create(
                0, 0,
                template.Width, template.Height,
                style,
                project.Options.PointShape);

            grid.IsStroked    = true;
            grid.IsFilled     = false;
            grid.IsGrid       = true;
            grid.OffsetX      = 30.0;
            grid.OffsetY      = 30.0;
            grid.CellWidth    = 30.0;
            grid.CellHeight   = 30.0;
            grid.State.Flags &= ~ShapeStateFlags.Printable;
            builder.Add(grid);
            layer.Shapes = builder.ToImmutable();

            return(template);
        }
Пример #8
0
 public FtpProject(IProjectFactory factory, IServiceProvider serviceProvider, FtpConnection connection)
     : base(factory, serviceProvider)
 {
     this._connection = connection;
     this._rootItem = new FtpConnectionProjectItem(this);
     ((IServiceContainer) base.GetService(typeof(IServiceContainer))).AddService(typeof(IWebDocumentRunService), this);
 }
Пример #9
0
 public CreateProjectViewModel(IProjectService projectService,
                               IProjectFactory projectFactory,
                               IFrameNavigationService navigationService) : base(navigationService)
 {
     _projectService = projectService;
     _projectFactory = projectFactory;
 }
 public ProjectCommandHandler(ProjectRepository projectRepository, UserRepository userRepository, IMembershipService authorizationService, IProjectFactory projectFactory)
 {
     this.projectRepository    = projectRepository;
     this.userRepository       = userRepository;
     this.authorizationService = authorizationService;
     this.projectFactory       = projectFactory;
 }
Пример #11
0
        public UserFactory(IProjectUserRepository projectUserRepository, IUserRepository userRepository, IProjectFactory projectFactory)
        {
            _projectUserRepository = projectUserRepository;
            _userRepository        = userRepository;

            _projectFactory = projectFactory;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectsController" /> class.
        /// </summary>
        /// <param name="projectsService">The projects service.</param>
        /// <param name="nugetService">The nuget service.</param>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="messageBoxService">The message box service.</param>
        /// <param name="resolverService">The resolver service.</param>
        /// <param name="viewModelViewsService">The view model views service.</param>
        /// <param name="readMeService">The read me service.</param>
        /// <param name="projectFactory">The project factory.</param>
        /// <param name="applicationService">The application service.</param>
        /// <param name="cachingService">The caching service.</param>
        public ProjectsController(
            IProjectsService projectsService,
            INugetService nugetService,
            IVisualStudioService visualStudioService,
            ISettingsService settingsService,
            IMessageBoxService messageBoxService,
            IResolverService resolverService,
            IViewModelViewsService viewModelViewsService,
            IReadMeService readMeService,
            IProjectFactory projectFactory,
            IApplicationService applicationService,
            ICachingService cachingService)
            : base(visualStudioService, settingsService, messageBoxService, resolverService, readMeService)
        {
            TraceService.WriteLine("ProjectsController::Constructor");

            this.projectsService       = projectsService;
            this.nugetService          = nugetService;
            this.viewModelViewsService = viewModelViewsService;
            this.projectFactory        = projectFactory;
            this.applicationService    = applicationService;
            this.cachingService        = cachingService;

            this.commands                = string.Empty;
            this.postNugetCommands       = new List <StudioCommand>();
            this.postNugetFileOperations = new List <FileOperation>();

            this.messages = new List <string>();
        }
        protected override ProjectRepository CreateSut()
        {
            connection     = Mock <IConnection>();
            projectFactory = Mock <IProjectFactory>();

            return(new ProjectRepository(connection, projectFactory));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="NugetPackagesFinishedViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="projectFactory">The project factory.</param>
 public NugetPackagesFinishedViewModel(
     ISettingsService settingsService,
     IProjectFactory projectFactory)
 {
     this.settingsService = settingsService;
     this.projectFactory = projectFactory;
     this.Init();
 }
Пример #15
0
 public ProjectController(
     IProjectRepository repository,
     IProjectFactory factory
     )
 {
     _repository = repository;
     _factory    = factory;
 }
Пример #16
0
 public SyncFactory(IProjectFactory factory, IConsole console, IFileSystem fileSystem,
     IDirectoryValidator validator)
 {
     _factory = factory;
     _console = console;
     _fileSystem = fileSystem;
     _validator = validator;
 }
Пример #17
0
 public Issue(IssueEstimation issueEstimation,
              Transportation.Repository.Interfaces.IIssueEstimationRepository issueEstimationRepository,
              IProjectFactory projectFactory)
 {
     _issueEstimation           = issueEstimation;
     _issueEstimationRepository = issueEstimationRepository;
     _projectFactory            = projectFactory;
 }
Пример #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NugetPackagesFinishedViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="projectFactory">The project factory.</param>
 public NugetPackagesFinishedViewModel(
     ISettingsService settingsService,
     IProjectFactory projectFactory)
 {
     this.settingsService = settingsService;
     this.projectFactory  = projectFactory;
     this.Init();
 }
Пример #19
0
 public ProjectService(IUnitOfWork unitOfWork,
                       IProjectFactory projectFactory,
                       IUserFactory userFactory)
 {
     _unitOfWork     = unitOfWork;
     _projectFactory = projectFactory;
     _userFactory    = userFactory;
 }
Пример #20
0
 public ProjectService(string directoryRoot, IProjectFactory factory, Func<IDataContext> dataProvider)
 {
     _directoryRoot = directoryRoot;
     _projectFolder = Path.Combine(directoryRoot, "Projects");
     EnsureFolders();
     _factory = factory;
     _dataProvider = dataProvider;
     EnsureProjectInfos();
 }
        public CreateProjectCommand(IAddProject addProject, IProjectFactory factory)
            : base(4)
        {
            Guard.WhenArgument(factory, "projectFactory").IsNull().Throw();
            Guard.WhenArgument(addProject, "addProject").IsNull().Throw();

            this.projectFactory = factory;
            this.addProject     = addProject;
        }
Пример #22
0
 public ProjectRepository(
     IContextFactory <Data.Contexts.FinancialContext> contextFactory,
     IProjectFactory projectFactory,
     IProjectEntityFactory entityFactory
     )
 {
     _contextFactory = contextFactory;
     _projectFactory = projectFactory;
     _entityFactory  = entityFactory;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="FrameworkSelectorViewModel" /> class.
        /// </summary>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="projectFactory">The project factory.</param>
        public FrameworkSelectorViewModel(
            IVisualStudioService visualStudioService,
            ISettingsService settingsService,
            IProjectFactory projectFactory)
        {
            this.visualStudioService = visualStudioService;
            this.settingsService     = settingsService;
            this.projectFactory      = projectFactory;

            this.Init();
        }
Пример #24
0
 public CreateProjectHandler(
     ILogger <CreateProjectHandler> logger,
     IMapper mapper,
     IProjectFactory projectFactory,
     ISquidDbContext squidDbContext)
 {
     this.mapper         = Guard.IsNotNull(mapper, nameof(mapper));
     this.squidDbContext = Guard.IsNotNull(squidDbContext, nameof(squidDbContext));
     this.logger         = Guard.IsNotNull(logger, nameof(logger));
     this.projectFactory = Guard.IsNotNull(projectFactory, nameof(projectFactory));
 }
Пример #25
0
        public User(Transportation.Entities.User user,
                    Transportation.Repository.Interfaces.IProjectUserRepository projectUserRepository,
                    Transportation.Repository.Interfaces.IUserRepository userRepository,
                    IProjectFactory projectFactory)
        {
            _user = user;
            _projectUserRepository = projectUserRepository;
            _userRepository        = userRepository;

            _projectFactory = projectFactory;
        }
 /// <summary>
 ///     Initializes a new instance of the <see cref="NugetPackagesBaseViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 protected NugetPackagesBaseViewModel(
     ISettingsService settingsService,
     IPluginsService pluginsService,
     IProjectFactory projectFactory,
     IPluginFactory pluginFactory)
 {
     this.settingsService = settingsService;
     this.pluginsService = pluginsService;
     this.projectFactory = projectFactory;
     this.pluginFactory = pluginFactory;
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="NugetPackagesBaseViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 protected NugetPackagesBaseViewModel(
     ISettingsService settingsService,
     IPluginsService pluginsService,
     IProjectFactory projectFactory,
     IPluginFactory pluginFactory)
 {
     this.settingsService = settingsService;
     this.pluginsService  = pluginsService;
     this.projectFactory  = projectFactory;
     this.pluginFactory   = pluginFactory;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="FrameworkSelectorViewModel" /> class.
        /// </summary>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="projectFactory">The project factory.</param>
        public FrameworkSelectorViewModel(
            IVisualStudioService visualStudioService,
            ISettingsService settingsService,
            IProjectFactory projectFactory)
        {
            this.visualStudioService = visualStudioService;
            this.settingsService = settingsService;
            this.projectFactory = projectFactory;

            this.Init();
        }
Пример #29
0
 public ProjectHandler(
     IEntityRepository<IEndowmentEntity> entityRepository,
     IProjectFactory projectFactory,
     IProjectRepository projectRepository,
     IDateTimeManager dateTimeManager)
 {
     _entityRepository = entityRepository;
     _projectFactory = projectFactory;
     _projectRepository = projectRepository;
     _dateTimeManager = dateTimeManager;
 }
Пример #30
0
 /// <summary>
 /// Creates a new instance of <see cref="StorageCommandHandler"/>.
 /// </summary>
 /// <param name="projectStorage">Class responsible to storing and loading the application project.</param>
 /// <param name="projectMigrator">Class responsible for the migration of the application projects.</param>
 /// <param name="projectFactory">The factory to use when creating new projects.</param>
 /// <param name="projectOwner">The class owning the application project.</param>
 /// <param name="inquiryHelper">The object facilitating user interaction.</param>
 /// <param name="mainWindowController">The object owning the parent controller for UI.</param>
 public StorageCommandHandler(IStoreProject projectStorage, IMigrateProject projectMigrator,
                              IProjectFactory projectFactory, IProjectOwner projectOwner,
                              IInquiryHelper inquiryHelper, IMainWindowController mainWindowController)
 {
     projectPersister          = projectStorage;
     this.projectMigrator      = projectMigrator;
     this.projectFactory       = projectFactory;
     this.projectOwner         = projectOwner;
     this.inquiryHelper        = inquiryHelper;
     this.mainWindowController = mainWindowController;
 }
Пример #31
0
 public NugetPackageToPushFinder(IFolderResolver folderResolver, IGitUtilities gitUtilities, INugetConfigReader nugetConfigReader, INugetFeedLister nugetFeedLister,
                                 IProjectFactory projectFactory, IPushedHeadTipShaRepository pushedHeadTipShaRepository, ISecretRepository secretRepository, IChangedBinariesLister changedBinariesLister)
 {
     FolderResolver             = folderResolver;
     GitUtilities               = gitUtilities;
     NugetConfigReader          = nugetConfigReader;
     NugetFeedLister            = nugetFeedLister;
     ProjectFactory             = projectFactory;
     PushedHeadTipShaRepository = pushedHeadTipShaRepository;
     SecretRepository           = secretRepository;
     ChangedBinariesLister      = changedBinariesLister;
 }
        public void ItemsDiff(string projectItems, string sdkBaselineItems, string expectedDefaultedItems, string expectedNotDefaultedItems, string expectedIntroducedItems, string expectedChangedItems)
        {
            var project            = IProjectFactory.Create(GetItems(projectItems));
            var sdkBaselineProject = IProjectFactory.Create(GetItems(sdkBaselineItems));

            var differ = new Differ(project, sdkBaselineProject);

            var diffs = differ.GetItemsDiff();

            if (expectedDefaultedItems == null)
            {
                Assert.All(diffs, diff => Assert.Empty(diff.DefaultedItems));
            }
            else
            {
                var expectedDiffItems = GetItems(expectedDefaultedItems);
                var matchingItems     = diffs.Select(diff => (diff.DefaultedItems.Select(i => i.EvaluatedInclude), expectedDiffItems.SingleOrDefault(d => d.ItemType == diff.ItemType).Items));
                Assert.All(matchingItems, diff => Assert.Equal(diff.Item1, diff.Items));
            }

            if (expectedNotDefaultedItems == null)
            {
                Assert.All(diffs, diff => Assert.Empty(diff.NotDefaultedItems));
            }
            else
            {
                var expectedDiffItems = GetItems(expectedNotDefaultedItems);
                var matchingItems     = diffs.Select(diff => (diff.NotDefaultedItems.Select(i => i.EvaluatedInclude), expectedDiffItems.SingleOrDefault(d => d.ItemType == diff.ItemType).Items));
                Assert.All(matchingItems, diff => Assert.Equal(diff.Item1, diff.Items));
            }

            if (expectedIntroducedItems == null)
            {
                Assert.All(diffs, diff => Assert.Empty(diff.IntroducedItems));
            }
            else
            {
                var expectedDiffItems = GetItems(expectedIntroducedItems);
                var matchingItems     = diffs.Select(diff => (diff.IntroducedItems.Select(i => i.EvaluatedInclude), expectedDiffItems.SingleOrDefault(d => d.ItemType == diff.ItemType).Items));
                Assert.All(matchingItems, diff => Assert.Equal(diff.Item1, diff.Items));
            }

            if (expectedChangedItems == null)
            {
                Assert.All(diffs, diff => Assert.Empty(diff.ChangedItems));
            }
            else
            {
                var expectedDiffItems = GetItems(expectedChangedItems);
                var matchingItems     = diffs.Select(diff => (diff.ChangedItems.Select(i => i.EvaluatedInclude), expectedDiffItems.SingleOrDefault(d => d.ItemType == diff.ItemType).Items));
                Assert.All(matchingItems, diff => Assert.Equal(diff.Item1, diff.Items));
            }
        }
Пример #33
0
        public TeamMember(ProjectUser projectUser,
                          IIssueEstimationRepository issueEstimationRepository,
                          IProjectFactory projectFactory,
                          IUserFactory userFactory)
        {
            _projectUser = projectUser;

            _issueEstimationRepository = issueEstimationRepository;

            User    = userFactory.Get(projectUser.User);
            Project = projectFactory.Get(projectUser.Project);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PluginsViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 public PluginsViewModel(
     ISettingsService settingsService,
     IPluginsService pluginsService,
     IProjectFactory projectFactory,
     IPluginFactory pluginFactory)
     : base(settingsService,
         pluginsService,
         projectFactory,
         pluginFactory)
 {
     this.settingsService = settingsService;
 }
Пример #35
0
 public DirectorySync(string directoryPath, ISyncFactory factory, IFileSystem fileSystem,
     IDirectoryValidator validator, IProjectFactory projectFactory)
 {
     var files = fileSystem.GetFiles(directoryPath, "*.csproj", SearchOption.AllDirectories);
     foreach (var file in files)
     {
         if (validator.IsDirectoryValid(file) && projectFactory.IsValidProject(file))
         {
             var project = factory.CreateProjectSynchronizer(file);
             _projects.Add(project);
         }
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="XamarinFormsLabsViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 public XamarinFormsLabsViewModel(
     ISettingsService settingsService,
     IPluginsService pluginsService,
     IProjectFactory projectFactory,
     IPluginFactory pluginFactory)
     : base(
         settingsService,
         pluginsService,
         projectFactory,
         pluginFactory)
 {
     this.settingsService = settingsService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ApplicationSamplesOptionsViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="cachingService">The caching service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 public ApplicationSamplesOptionsViewModel(
     ISettingsService settingsService,
     ICachingService cachingService,
     IPluginsService pluginsService,
     IProjectFactory projectFactory,
     IPluginFactory pluginFactory)
     : base(settingsService,
      pluginsService,
      projectFactory,
      pluginFactory)
 {
     this.settingsService = settingsService;
     this.cachingService = cachingService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectsFinishedViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="visualStudioService">The visual studio service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="cachingService">The caching service.</param>
 /// <param name="tinyMessengerHub">The tiny messenger hub.</param>
 public ProjectsFinishedViewModel(
     ISettingsService settingsService,
     IVisualStudioService visualStudioService,
     IProjectFactory projectFactory,
     ICachingService cachingService,
     ITinyMessengerHub tinyMessengerHub)
 {
     this.settingsService     = settingsService;
     this.visualStudioService = visualStudioService;
     this.projectFactory      = projectFactory;
     this.cachingService      = cachingService;
     this.tinyMessengerHub    = tinyMessengerHub;
     this.Init();
 }
Пример #39
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectsViewModel" /> class.
        /// </summary>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="projectFactory">The project factory.</param>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="messageBoxService">The message box service.</param>
        /// <param name="folderBrowserDialogService">The folder browser dialog service.</param>
        /// <param name="cachingService">The caching service.</param>
        public ProjectsViewModel(
            IVisualStudioService visualStudioService,
            ISettingsService settingsService,
            IProjectFactory projectFactory,
            IFileSystem fileSystem,
            IMessageBoxService messageBoxService,
            IFolderBrowserDialogService folderBrowserDialogService,
            ICachingService cachingService)
        {
            TraceService.WriteLine("ProjectsViewModel::Constructor Start");

            this.visualStudioService        = visualStudioService;
            this.settingsService            = settingsService;
            this.fileSystem                 = fileSystem;
            this.projectFactory             = projectFactory;
            this.messageBoxService          = messageBoxService;
            this.folderBrowserDialogService = folderBrowserDialogService;
            this.cachingService             = cachingService;

            this.projects = new ObservableCollection <SelectableItemViewModel <ProjectTemplateInfo> >();

            //// set the defaults!
            this.Project = visualStudioService.GetDefaultProjectName();

            if (string.IsNullOrEmpty(this.Project) &&
                this.settingsService.UseTempProjectName)
            {
                this.Project = "P" + DateTime.Now.ToString("yyMMddHHmm");
            }

            string defaultPath = this.settingsService.DefaultProjectsPath;

            //// if we are already in the solution disable project name and path.
            this.solutionAlreadyCreated = this.visualStudioService.SolutionAlreadyCreated;

            if (this.solutionAlreadyCreated)
            {
                TraceService.WriteLine("Solution already created");

                this.Path = visualStudioService.SolutionService.GetParentDirectoryName();
            }
            else
            {
                this.Path = string.IsNullOrEmpty(defaultPath) == false
                                ? defaultPath
                                : visualStudioService.DTEService.GetDefaultProjectsLocation();
            }

            TraceService.WriteLine("ProjectsViewModel::Constructor End");
        }
Пример #40
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ApplicationOptionsViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 /// <param name="cachingService">The caching service.</param>
 /// <param name="projectFactory">The project factory.</param>
 public ApplicationOptionsViewModel(
     ISettingsService settingsService,
     IPluginsService pluginsService,
     IPluginFactory pluginFactory,
     ICachingService cachingService,
     IProjectFactory projectFactory)
     : base(
         settingsService,
         pluginsService,
         projectFactory,
         pluginFactory)
 {
     this.settingsService = settingsService;
     this.cachingService  = cachingService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NugetPackagesViewModel" /> class.
 /// </summary>
 /// <param name="applicationService">The application service.</param>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 /// <param name="cachingService">The caching service.</param>
 public NugetPackagesViewModel(
     IApplicationService applicationService,
     ISettingsService settingsService,
     IPluginsService pluginsService,
     IProjectFactory projectFactory,
     IPluginFactory pluginFactory,
     ICachingService cachingService)
     : base(settingsService,
         pluginsService,
         projectFactory,
         pluginFactory)
 {
     this.applicationService = applicationService;
     this.settingsService = settingsService;
     this.pluginFactory = pluginFactory;
     this.cachingService = cachingService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NugetPackagesViewModel" /> class.
 /// </summary>
 /// <param name="applicationService">The application service.</param>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 /// <param name="cachingService">The caching service.</param>
 public NugetPackagesViewModel(
     IApplicationService applicationService,
     ISettingsService settingsService,
     IPluginsService pluginsService,
     IProjectFactory projectFactory,
     IPluginFactory pluginFactory,
     ICachingService cachingService)
     : base(
         settingsService,
         pluginsService,
         projectFactory,
         pluginFactory)
 {
     this.applicationService = applicationService;
     this.settingsService    = settingsService;
     this.pluginFactory      = pluginFactory;
     this.cachingService     = cachingService;
 }
        public void ItemsDiff_GetLines_Partial()
        {
            var defaultedItems  = IProjectFactory.Create(GetItems("X:Y,Z")).Items.ToImmutableArray();
            var removedItems    = ImmutableArray <IProjectItem> .Empty;
            var introducedItems = ImmutableArray <IProjectItem> .Empty;
            var changedItems    = ImmutableArray <IProjectItem> .Empty;
            var diff            = new ItemsDiff("X", defaultedItems, removedItems, introducedItems, changedItems);

            var lines         = diff.GetDiffLines();
            var expectedLines = new[]
            {
                "X items:",
                "- Y",
                "- Z",
                "",
            };

            Assert.Equal(expectedLines, lines);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectsViewModel" /> class.
        /// </summary>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="projectFactory">The project factory.</param>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="messageBoxService">The message box service.</param>
        /// <param name="folderBrowserDialogService">The folder browser dialog service.</param>
        /// <param name="cachingService">The caching service.</param>
        public ProjectsViewModel(
            IVisualStudioService visualStudioService,
            ISettingsService settingsService,
            IProjectFactory projectFactory,
            IFileSystem fileSystem,
            IMessageBoxService messageBoxService,
            IFolderBrowserDialogService folderBrowserDialogService,
            ICachingService cachingService)
        {
            TraceService.WriteLine("ProjectsViewModel::Constructor Start");

            this.visualStudioService = visualStudioService;
            this.settingsService = settingsService;
            this.fileSystem = fileSystem;
            this.projectFactory = projectFactory;
            this.messageBoxService = messageBoxService;
            this.folderBrowserDialogService = folderBrowserDialogService;
            this.cachingService = cachingService;

            this.projects = new ObservableCollection<SelectableItemViewModel<ProjectTemplateInfo>>();

            //// set the defaults!
            this.Project = visualStudioService.GetDefaultProjectName();

            if (string.IsNullOrEmpty(this.Project)
                && this.settingsService.UseTempProjectName)
            {
                this.Project = "P" + DateTime.Now.ToString("yyMMddHHmm");
            }

            string defaultPath = this.settingsService.DefaultProjectsPath;

            //// if we are already in the solution disable project name and path.
            this.solutionAlreadyCreated = this.visualStudioService.SolutionAlreadyCreated;

            if (this.solutionAlreadyCreated)
            {
                TraceService.WriteLine("Solution already created");

                this.Path = visualStudioService.SolutionService.GetParentDirectoryName();
            }
            else
            {
                this.Path = string.IsNullOrEmpty(defaultPath) == false
                                ? defaultPath
                                : visualStudioService.DTEService.GetDefaultProjectsLocation();
            }

            TraceService.WriteLine("ProjectsViewModel::Constructor End");
        }
Пример #45
0
 public ShortcutProject(IProjectFactory factory, IServiceProvider serviceProvider, string rootDirectory)
     : base(factory, serviceProvider)
 {
     this._rootItem = new ShortcutProjectItem(this, rootDirectory);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectsController" /> class.
        /// </summary>
        /// <param name="projectsService">The projects service.</param>
        /// <param name="nugetService">The nuget service.</param>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="messageBoxService">The message box service.</param>
        /// <param name="resolverService">The resolver service.</param>
        /// <param name="viewModelViewsService">The view model views service.</param>
        /// <param name="readMeService">The read me service.</param>
        /// <param name="projectFactory">The project factory.</param>
        /// <param name="applicationService">The application service.</param>
        /// <param name="cachingService">The caching service.</param>
        public ProjectsController(
            IProjectsService projectsService,
            INugetService nugetService,
            IVisualStudioService visualStudioService,
            ISettingsService settingsService,
            IMessageBoxService messageBoxService,
            IResolverService resolverService,
            IViewModelViewsService viewModelViewsService,
            IReadMeService readMeService,
            IProjectFactory projectFactory,
            IApplicationService applicationService,
            ICachingService cachingService)
            : base(visualStudioService, settingsService, messageBoxService, resolverService, readMeService)
        {
            TraceService.WriteLine("ProjectsController::Constructor");

            this.projectsService = projectsService;
            this.nugetService = nugetService;
            this.viewModelViewsService = viewModelViewsService;
            this.projectFactory = projectFactory;
            this.applicationService = applicationService;
            this.cachingService = cachingService;

            this.commands = string.Empty;
            this.postNugetCommands = new List<StudioCommand>();
            this.postNugetFileOperations = new List<FileOperation>();

            this.messages = new List<string>();
        }
Пример #47
0
 public SqlDatabaseProject(IProjectFactory factory, IServiceProvider serviceProvider, SqlDatabase database)
     : base(factory, serviceProvider, database)
 {
     this._sqlDatabase = database;
     this._rootItem = new SqlDatabaseProjectItem(this);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectsFinishedViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="visualStudioService">The visual studio service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="cachingService">The caching service.</param>
 /// <param name="tinyMessengerHub">The tiny messenger hub.</param>
 public ProjectsFinishedViewModel(
     ISettingsService settingsService,
     IVisualStudioService visualStudioService,
     IProjectFactory projectFactory,
     ICachingService cachingService,
     ITinyMessengerHub tinyMessengerHub)
 {
     this.settingsService = settingsService;
     this.visualStudioService = visualStudioService;
     this.projectFactory = projectFactory;
     this.cachingService = cachingService;
     this.tinyMessengerHub = tinyMessengerHub;
     this.Init();
 }
Пример #49
0
 public FileSystemProject(IProjectFactory factory, IServiceProvider serviceProvider)
     : base(factory, serviceProvider)
 {
 }
Пример #50
0
 public Project(IProjectFactory factory, IServiceProvider serviceProvider)
 {
     this._factory = factory;
     this._serviceProvider = serviceProvider;
     this._serviceContainer = new ServiceContainer(serviceProvider);
 }
Пример #51
0
 public WorkspaceProject(IProjectFactory factory, IServiceProvider serviceProvider)
     : base(factory, serviceProvider)
 {
 }
Пример #52
0
 public AccessDatabaseProject(IProjectFactory factory, IServiceProvider serviceProvider, AccessDatabase database)
     : base(factory, serviceProvider, database)
 {
     this._accessDatabase = database;
     this._rootItem = new AccessDatabaseProjectItem(this);
 }
Пример #53
0
 public ProjectFactoryItem(IProjectFactory factory)
 {
     this._factory = factory;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectsViewModel" /> class.
        /// </summary>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="projectFactory">The project factory.</param>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="messageBoxService">The message box service.</param>
        /// <param name="folderBrowserDialogService">The folder browser dialog service.</param>
        /// <param name="viewModelAndViewsFactory">The view model and views factory.</param>
        public ProjectsViewModel(
            IVisualStudioService visualStudioService,
            ISettingsService settingsService,
            IProjectFactory projectFactory,
            IFileSystem fileSystem,
            IMessageBoxService messageBoxService,
            IFolderBrowserDialogService folderBrowserDialogService,
            IViewModelAndViewsFactory viewModelAndViewsFactory)
            : base(settingsService)
        {
            TraceService.WriteLine("ProjectsViewModel::Constructor Start");

            this.settingsService = settingsService;
            this.fileSystem = fileSystem;
            this.messageBoxService = messageBoxService;
            this.folderBrowserDialogService = folderBrowserDialogService;

            this.projects = new ObservableCollection<SelectableItemViewModel<ProjectTemplateInfo>>();

            IEnumerable<ProjectTemplateInfo> projectTemplateInfos = projectFactory.GetAllowedProjects();

            foreach (SelectableItemViewModel<ProjectTemplateInfo> viewModel in projectTemplateInfos
                .Select(projectTemplateInfo => new SelectableItemViewModel<ProjectTemplateInfo>(projectTemplateInfo, projectTemplateInfo.PreSelected)))
            {
                this.projects.Add(viewModel);
            }

            //// set the defaults!
            this.Project = visualStudioService.GetDefaultProjectName();

            string defaultPath = this.settingsService.DefaultProjectsPath;

            //// if we are already in the solution disable project name and path.
            this.solutionAlreadyCreated = this.Project.Length > 0;

            this.Path = string.IsNullOrEmpty(defaultPath) == false ? defaultPath : visualStudioService.DTEService.GetDefaultProjectsLocation();

            this.useNuget = this.settingsService.UseNugetForProjectTemplates;

            this.viewTypes = viewModelAndViewsFactory.GetAvailableViewTypes();
            this.selectedViewType = this.settingsService.SelectedViewType;

            TraceService.WriteLine("ProjectsViewModel::Constructor End");
        }
Пример #55
0
 public DatabaseProject(IProjectFactory factory, IServiceProvider serviceProvider, Microsoft.Matrix.Packages.DBAdmin.DBEngine.Database database)
     : base(factory, serviceProvider)
 {
     this._database = database;
 }
Пример #56
0
 public MyComputerProject(IProjectFactory factory, IServiceProvider serviceProvider)
     : base(factory, serviceProvider)
 {
     this._rootItem = new MyComputerProjectItem(this);
     this.LoadMruEntries();
 }
Пример #57
0
 private Project CreateProject(IProjectFactory factory, object creationArgs)
 {
     Project project = null;
     if (factory.IsSingleInstance)
     {
         foreach (Project project2 in this._openProjects)
         {
             if (project2.ProjectFactory == factory)
             {
                 project = project2;
                 break;
             }
         }
     }
     if (project == null)
     {
         try
         {
             project = factory.CreateProject(creationArgs);
         }
         catch (Exception exception)
         {
             IMxUIService service = (IMxUIService) this._serviceProvider.GetService(typeof(IMxUIService));
             if (service != null)
             {
                 service.ReportError(exception.Message, "Unable to create a new " + factory.Name + " workspace.", false);
             }
         }
         if (project == null)
         {
             return project;
         }
         this._openProjects.Add(project);
         if ((this._myComputerProject == null) && (factory.GetType() == this._myComputerFactoryType))
         {
             this._myComputerProject = project;
         }
         try
         {
             ProjectEventArgs e = new ProjectEventArgs(project);
             this.OnProjectAdded(e);
         }
         catch (Exception)
         {
         }
     }
     return project;
 }
Пример #58
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         this._serviceContainer = null;
         this._serviceProvider = null;
         this._factory = null;
     }
 }
Пример #59
0
        /// <summary>
        /// Creates a new instance of the <see cref="XContainer"/> class.
        /// </summary>
        /// <param name="factory">The project factory.</param>
        /// <param name="project">The new container owner project.</param>
        /// <param name="name">The new container name.</param>
        /// <returns>The new instance of the <see cref="XContainer"/>.</returns>
        private XContainer CreateGridTemplate(IProjectFactory factory, XProject project, string name)
        {
            var template = factory.GetTemplate(project, name);

            var style = project
                .StyleLibraries.FirstOrDefault(g => g.Name == "Template")
                .Items.FirstOrDefault(s => s.Name == "Grid");
            var layer = template.Layers.FirstOrDefault();
            var builder = layer.Shapes.ToBuilder();
            var grid = XRectangle.Create(
                0, 0,
                template.Width, template.Height,
                style,
                project.Options.PointShape);
            grid.IsStroked = true;
            grid.IsFilled = false;
            grid.IsGrid = true;
            grid.OffsetX = 30.0;
            grid.OffsetY = 30.0;
            grid.CellWidth = 30.0;
            grid.CellHeight = 30.0;
            grid.State.Flags &= ~ShapeStateFlags.Printable;
            builder.Add(grid);
            layer.Shapes = builder.ToImmutable();

            return template;
        }
Пример #60
0
 public FactoryListViewItem(IProjectFactory factory, int imageIndex)
     : base(factory.Name, imageIndex)
 {
     this._factory = factory;
 }