bool ProcessAssemblyReferenceGroup(XmlNode section)
{
XmlNodeList allReferences = section.HasChildNodes ? section.ChildNodes : null;
if(allReferences != null)
{
List<AssemblyReference> group = new List<AssemblyReference>();
foreach(XmlNode current in allReferences)
if(String.Equals(current.Name, "AssemblyReference", StringComparison.OrdinalIgnoreCase))
{
XmlAttributeCollection allAttribs = current.Attributes;
string path = null, culture = null, version = null, publicKeyToken = null;
if(allAttribs != null)
{
foreach(XmlAttribute currentAttrib in allAttribs)
{
if(String.Equals(currentAttrib.Name, "Path", StringComparison.OrdinalIgnoreCase))
{
path = currentAttrib.Value;
}
else if(String.Equals(currentAttrib.Name, "Culture", StringComparison.OrdinalIgnoreCase))
{
culture = currentAttrib.Value;
}
else if(String.Equals(currentAttrib.Name, "Version", StringComparison.OrdinalIgnoreCase))
{
version = currentAttrib.Value;
}
else if(String.Equals(currentAttrib.Name, "PublicKeyToken", StringComparison.OrdinalIgnoreCase))
{
publicKeyToken = currentAttrib.Value;
}
}
}
// ReSharper disable ConvertIfStatementToConditionalTernaryExpression
if(path == null)
// ReSharper restore ConvertIfStatementToConditionalTernaryExpression
{
group.Add(new AssemblyReference(current.InnerText, version, culture, publicKeyToken));
}
else
{
group.Add(new AssemblyReference(current.InnerText, path));
}
}
if(group.Count > 0)
{
if(_externalDependencies.Length != 0)
{
group.AddRange(_externalDependencies);
}
_externalDependencies = group.ToArray();
}
}
return true;
}