我试图迭代HashTable并更新值,只要它通过一些条件.这是代码.
public static Hashtable AssembliesGlobal= new Hashtable();
public static void populateHash(){
NDepend.Path.IAbsolutePath assemblyName;
NDepend.Path.IAbsolutePath projectName;
for (int i = 0; i < someList.Count(); i++)
{
if (someList[i].AssembliesUsed.Count() > 0)
{
assemblyName = getAssemblyQuery[i].a.FilePath;
if (getAssemblyQuery[i].a.VisualStudioProjectFilePath != null)
{
List<IAbsolutePath> thirdPartyList = new List<IAbsolutePath>();
projectName = getAssemblyQuery[i].a.VisualStudioProjectFilePath;
thirdPartyList.Add(assemblyName);
AssembliesGlobal.Add(projectName, thirdPartyList);
}
}
}
}
public static void parseCsproj()
{
foreach (IAbsoluteFilePath key in AssembliesGlobal.Keys)
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(key.FileInfo.FullName);
XmlNodeList references = xmldoc.GetElementsByTagName("ProjectReference");
XmlNodeList hintReferences = xmldoc.GetElementsByTagName("HintPath");
if (references.Count …Run Code Online (Sandbox Code Playgroud)