CCNet.Build.Tfs.TfsClient.ReadFile C# (CSharp) Method

ReadFile() public method

public ReadFile ( string path ) : string
path string
return string
		public string ReadFile(string path)
		{
			var item = m_server.GetItem(path);
			using (var sr = new StreamReader(item.DownloadFile(), Encoding.UTF8))
			{
				return sr.ReadToEnd();
			}
		}

Usage Example

		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();
		}