Example #1
0
		public PageBuilder(CachedConfluenceClient confluence, TfsClient tfs, BuildOwners owners)
		{
			if (confluence == null)
				throw new ArgumentNullException(nameof(confluence));

			if (tfs == null)
				throw new ArgumentNullException(nameof(tfs));

			if (owners == null)
				throw new ArgumentNullException(nameof(owners));

			m_confluence = confluence;
			m_tfs = tfs;
			m_owners = owners;
		}
Example #2
0
		private static void SaveSource()
		{
			Console.Write("Saving TFS location... ");

			Args.TempPath.CreateDirectoryIfNotExists();

			var client = new TfsClient(Config.TfsUrl);
			var changeset = client.GetLatestChangeset(Args.TfsPath);

			var sb = new StringBuilder();
			sb.AppendLine("Source:");
			sb.AppendLine(Args.TfsPath);
			sb.AppendFormat("Changeset #{0}", changeset.Id).AppendLine();
			sb.AppendFormat("User: {0}", changeset.UserDisplay).AppendLine();
			sb.AppendFormat("Date: {0}", changeset.Date.ToDetailedString()).AppendLine();

			var file = Path.Combine(Args.TempPath, "source.txt");
			File.WriteAllText(file, sb.ToString());

			Console.WriteLine("OK");
		}
Example #3
0
		public virtual void CheckPage(TfsClient client)
		{
		}
		public override void CheckPage(TfsClient client)
		{
			base.CheckPage(client);

			var path = TfsPath;

			if (!CheckTfsPathArea(path, AreaName))
				throw new InvalidOperationException($"TFS path '{path}' seems not conforming with area name '{AreaName}'.");

			if (!CheckTfsPathProject(path, ProjectName))
				throw new InvalidOperationException($"TFS path '{path}' seems not conforming with project name '{ProjectName}'.");

			var project = new ProjectDocument(() => client.ReadFile(ProjectFile));

			ProjectUid = project.GetProjectGuid();
		}