Exemplo n.º 1
0
 public static void Create(Project project,
                           Package package)
 {
     var packages = new List<Package>
                        {
                            package
                        };
     Create(project, packages);
 }
Exemplo n.º 2
0
        public static void Create(Project project,
                                  IEnumerable<Package> packages)
        {
            var xml = EmptyTemplate;
            var navigator = xml.CreateNavigator();
            navigator.MoveToChild("packages", string.Empty);

            foreach (var package in packages)
            {
                using (var writer = navigator.AppendChild())
                {
                    writer.WriteStartElement("package");
                    writer.WriteAttributeString("id", package.Id);
                    writer.WriteAttributeString("version", package.Version);
                }
            }

            project.Location.Directory.ToFile("packages.config").Create(xml);
        }
Exemplo n.º 3
0
 public static void Create(Project project)
 {
     Create(project, new List<Package>());
 }