private PublishDialogWindow(ISolutionProject project) :
            base(String.Format(GoogleCloudExtension.Resources.PublishDialogCaption, project.Name))
        {
            var initialStep = ChoiceStepViewModel.CreateStep();

            ViewModel = new PublishDialogWindowViewModel(project, initialStep, this);
            Content = new PublishDialogWindowContent { DataContext = ViewModel };
        }
        public FileEventListener Create(ISolutionProject project, ActionConfiguration actionConfiguration)
        {
            var fileChangeSubscriber = new FileChangeSubscriber(this.fileChangeService);
            var fileMonitor = new FileMonitor(this.solutionFilesService, this.globMatcher, fileChangeSubscriber, this.outputService);

            var eventListener = new FileEventListener(fileMonitor, this.onChangeTaskDispatcher, this.actionFactory, fileChangeSubscriber);
            eventListener.Initialize(project, actionConfiguration);
            return eventListener;
        }
Beispiel #3
0
        private PublishDialogWindow(ISolutionProject project) :
            base(String.Format(GoogleCloudExtension.Resources.PublishDialogCaption, project.Name))
        {
            var initialStep = ChoiceStepViewModel.CreateStep();

            ViewModel = new PublishDialogWindowViewModel(project, initialStep, this);
            Content   = new PublishDialogWindowContent {
                DataContext = ViewModel
            };
        }
        public PublishDialogWindowViewModel(ISolutionProject project, IPublishDialogStep initialStep, PublishDialogWindow owner)
        {
            _owner = owner;
            _project = project;

            PrevCommand = new ProtectedCommand(OnPrevCommand);
            NextCommand = new ProtectedCommand(OnNextCommand);
            PublishCommand = new ProtectedCommand(OnPublishCommand);

            PushStep(initialStep);
        }
        public PublishDialogWindowViewModel(ISolutionProject project, IPublishDialogStep initialStep, PublishDialogWindow owner)
        {
            _owner   = owner;
            _project = project;

            PrevCommand    = new ProtectedCommand(OnPrevCommand);
            NextCommand    = new ProtectedCommand(OnNextCommand);
            PublishCommand = new ProtectedCommand(OnPublishCommand);

            PushStep(initialStep);
        }
Beispiel #6
0
        private bool TryGetConfigPath(ISolutionProject project, out string configPath)
        {
            configPath = null;
            var projectRoot = Path.GetDirectoryName(project.ProjectFilePath);
            if (string.IsNullOrWhiteSpace(projectRoot))
            {
                return false;
            }

            configPath = Path.Combine(projectRoot, "goose.config");
            return File.Exists(configPath);
        }
Beispiel #7
0
        public IEnumerable<ActionConfiguration> GetActionConfigurations(ISolutionProject project)
        {
            string configPath;
            if (this.TryGetConfigPath(project, out configPath))
            {
                var projectRoot = Path.GetDirectoryName(project.ProjectFilePath);
                var solutionRoot = Path.GetDirectoryName(project.SolutionFilePath);
                using (var fileStream = File.OpenRead(configPath))
                {
                    return this.configParser.Parse(solutionRoot, projectRoot, fileStream);
                }
            }

            return Enumerable.Empty<ActionConfiguration>();
        }
Beispiel #8
0
        public void BuildTree(IEnumerable <ProjectInSolution> projectsInSolution, ISolutionProject parentComposite)
        {
            foreach (var projectChild in projectsInSolution)
            {
                if (projectChild.ProjectType == SolutionProjectType.SolutionFolder)
                {
                    var currentComposite = new SolutionFolder(projectChild.ProjectName);
                    parentComposite.Add(currentComposite);

                    BuildTree(GetProjectsInSolution(projectChild.ProjectGuid), currentComposite);
                }
                else
                {
                    var leaf = new SolutionProject(projectChild.ProjectName);
                    parentComposite.Add(leaf);
                    AddProjectDependecies(leaf, projectChild);
                }
            }
        }
Beispiel #9
0
 public void Add(ISolutionProject project)
 {
     Projects.Add(project);
 }
Beispiel #10
0
        /// <summary>
        /// Starts the publish wizard for the given <paramref name="project"/>.
        /// </summary>
        /// <param name="project">The project to publish.</param>
        public static void PromptUser(ISolutionProject project)
        {
            var dialog = new PublishDialogWindow(project);

            dialog.ShowModal();
        }
        private void ConnectProjectEventListeners(ISolutionProject project)
        {
            var actionConfigurations = this.configReader.GetActionConfigurations(project);

            foreach (var action in actionConfigurations)
            {
                this.outputService.Debug<SolutionEventListener>("Connecting to: " + project.ProjectFilePath);
                var actionConfiguration = action;
                this.fileEventListeners.AddOrUpdate(
                    project.ProjectFilePath,
                    new List<WatchItem>
                    {
                        new WatchItem(this.fileEventListenerFactory.Create(project, actionConfiguration), actionConfiguration)
                    },
                    (key, existingListener) =>
                    {
                        if (!existingListener.Any(watchItem => watchItem.Item2.Equals(actionConfiguration)))
                        {
                            var listener = this.fileEventListenerFactory.Create(project, actionConfiguration);
                            existingListener.Add(new WatchItem(listener, actionConfiguration));
                        }
                        return existingListener;
                    });
            }
        }
 public FakeProjectContext(ISolutionProject project, IFileChangeSubscriber fileChangeSubscriber)
 {
     this.project = project;
     this.fileChangeSubscriber = fileChangeSubscriber;
 }
Beispiel #13
0
        /// <summary>
        /// Returns true if <paramref name="project"/> can be published using this wizard.
        /// </summary>
        /// <param name="project">The project to check.</param>
        /// <returns>True if the project is supported by this wizard, false otherwise.</returns>
        public static bool CanPublish(ISolutionProject project)
        {
            var projectType = project.ProjectType;

            return(projectType == KnownProjectTypes.WebApplication || projectType == KnownProjectTypes.NetCoreWebApplication);
        }
 /// <summary>
 /// Starts the publish wizard for the given <paramref name="project"/>.
 /// </summary>
 /// <param name="project">The project to publish.</param>
 public static void PromptUser(ISolutionProject project)
 {
     var dialog = new PublishDialogWindow(project);
     dialog.ShowModal();
 }
        public void Initialize(ISolutionProject project, ActionConfiguration watchConfiguration)
        {
            this.configuration = watchConfiguration;

            var projectPath = project.ProjectFilePath;
            if (this.configuration.IsValid && !string.IsNullOrWhiteSpace(projectPath))
            {
                this.configuration = watchConfiguration;
                this.fileMonitor.MonitorProject(project.ProjectFilePath, watchConfiguration.Glob);
            }
        }
Beispiel #16
0
 public void Add(ISolutionProject project)
 {
     throw new Exception("Project cannot contain another project!");
 }
 public void AddProject(ISolutionProject solutionProject)
 {
     this.SolutionProjectCollection.Add(solutionProject);
 }
 /// <summary>
 /// Returns true if <paramref name="project"/> can be published using this wizard.
 /// </summary>
 /// <param name="project">The project to check.</param>
 /// <returns>True if the project is supported by this wizard, false otherwise.</returns>
 public static bool CanPublish(ISolutionProject project)
 {
     var projectType = project.ProjectType;
     return projectType == KnownProjectTypes.WebApplication || projectType == KnownProjectTypes.NetCoreWebApplication;
 }