Tuesday

template engine .net

 
using System.Collections;

namespace Business.CustomerServices
{
public class SimpleTemplateEngine
{

public string ReadFile(string f)
{
System.IO.StreamReader file = new System.IO.StreamReader(f);
string testxmldata = file.ReadToEnd(); file.Close();
return testxmldata;
}


public string RenderFile(Hashtable values, string fileName)
{
return Render(values, ReadFile(fileName));
}


public string Render(Hashtable values, string template)
{
foreach (DictionaryEntry entry in values)
{
template = template.Replace("{$" + entry.Key + "}",""+ entry.Value);
}
return template;
}

}

}

No comments:

here is powershell script on how to get list of files from changesets associated with one tfs task

$dllPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\...