Exemplo n.º 1
0
        private string ConvertFileToString(string fileName)
        {
            var result = new StringBuilder();

            _shellLocks.TryExecuteWithReadLock(() =>
            {
                var project = PsiNavigationHelper.GetProjectByName(_solution, _currentStep.ProjectName);
                var file    = PsiNavigationHelper.GetCSharpFile(project, fileName);

                if (file == null)
                {
                    return;
                }
                var treeNodeList = file.EnumerateTo(file.LastChild);

                foreach (var node in treeNodeList)
                {
                    result.AppendSlice(node.GetText());
                }
            });

            return(result.ToString());
        }