Cake.Web.Core.Content.Documentation.TopicReader.ReadBody C# (CSharp) Метод

ReadBody() приватный Метод

private ReadBody ( DirectoryPath root, string path, string uri ) : string
root DirectoryPath
path string
uri string
Результат string
        private string ReadBody(DirectoryPath root, string path, string uri)
        {
            if (!string.IsNullOrWhiteSpace(path))
            {
                var file = _fileSystem.GetFile(root.CombineWithFilePath(path));
                if (file.Exists)
                {
                    using (var stream = file.OpenRead())
                    using (var reader = new StreamReader(stream))
                    {
                        return reader.ReadToEnd();
                    }
                }
            }
            else if (!string.IsNullOrWhiteSpace(uri))
            {
                return new System.Net.WebClient().DownloadString(uri);
            }
            return null;
        }