Exemple #1
0
        public void Execute(Solution solution, CodeDirectory codeDirectory)
        {
            foreach (var reference in codeDirectory.References)
            {
                var project = solution.GetProject(codeDirectory.Project.AssemblyName);
                var referencedProject = solution.FindProject(reference.Name);
                if (referencedProject != null)
                {
                    project.AddReference(new ProjectReference
                    {
                        Project = referencedProject, 
                        RelativePathToProject = relativePathGenerator.GeneratePath(project.Path, referencedProject.GeneratedProjectFilePath)
                    });
                }
                else
                {
                    var assemblyReference = new AssemblyReference {Name = reference.Name, HintPath = reference.HintPath};

                    assemblyReference.HintPath = assemblyReference.HintPath;

                    project.AddReference(assemblyReference);
                }
            }

            codeDirectory.Directories.Each(x => Execute(solution, x));
        }
Exemple #2
0
 public void AddReference(AssemblyReference assemblyReference)
 {
     if (assemblyReference == null) throw new ArgumentNullException("assemblyReference");
     assemblyReferences.Add(assemblyReference);
 }