Save() публичный Метод

Saves project file to disk.
public Save ( ) : void
Результат void
Пример #1
0
		public void Adjust()
		{
			Console.Write("Loading project... ");
			var project = new ProjectDocument(Args.ProjectFile);
			Console.WriteLine("OK");

			ConvertProjectReferences(project);
			UpdateReferenceVersions(project);
			SetupRelatedProjects(project);

			Console.Write("Saving project... ");
			project.Save();
			Console.WriteLine("OK");
		}
Пример #2
0
		private static void SetupRelatedProjects()
		{
			string path;
			switch (Args.ProjectType)
			{
				case ProjectType.CloudService:
					path = Paths.CloudProjectFile;
					break;

				case ProjectType.FabricApplication:
					path = Paths.FabricProjectFile;
					break;

				default:
					return;
			}

			if (String.IsNullOrEmpty(Args.RelatedPath))
				throw new InvalidOperationException("Configuration argument 'RelatedPath' is not set.");

			if (String.IsNullOrEmpty(Args.ReferencesPath))
				throw new InvalidOperationException("Configuration argument 'ReferencesPath' is not set.");

			Args.RelatedPath.CreateDirectoryIfNotExists();
			Args.ReferencesPath.CreateDirectoryIfNotExists();

			Console.Write("Converting paths for related projects... ");

			var project = new ProjectDocument(path);

			var references = project.GetProjectReferences();
			if (references.Count == 0)
				throw new InvalidOperationException("It is strange that cloud service or fabric application does not have any referenced projects.");

			var log = new LogPackages();
			foreach (var reference in references)
			{
				SetupRelatedProject(reference, log);
			}

			project.Save();
			Console.WriteLine("OK");

			log.Report();

			Console.Write("Saving local references... ");
			log.SaveReferences(Args.ReferencesPath);
			Console.WriteLine("OK");

			Console.Write("Saving packages summary... ");
			log.SaveSummary(Args.TempPath);
			Console.WriteLine("OK");
		}