private NetworkConfigurationSet GetNetworkConfigurationSet(XElement configurationSet)
{
NetworkConfigurationSet networkConfigurationSet = null;
if (configurationSet.Element(Namespace + "ConfigurationSetType").Value == "NetworkConfiguration")
{
networkConfigurationSet = new NetworkConfigurationSet();
var subnets = configurationSet.Element(Namespace + "SubnetNames");
if (subnets != null)
{
var subnet = subnets.Element(Namespace + "SubnetName");
if (subnet != null)
{
networkConfigurationSet.SubnetName = (string) subnet;
}
}
networkConfigurationSet.InputEndpoints= new InputEndpoints();
var endpoints = configurationSet.Descendants(Namespace + "InputEndpoint");
foreach (var endpoint in endpoints)
{
var inputEndpoint = new InputEndpoint
{
EndpointName = GetStringValue(endpoint.Element(Namespace + "Name")),
Port = GetIntValue(endpoint.Element(Namespace + "Port")),
LocalPort = GetIntValue(endpoint.Element(Namespace + "LocalPort")),
Protocol = GetEnumValue<Protocol>(endpoint.Element(Namespace + "Protocol")),
Vip = GetStringValue(endpoint.Element(Namespace + "Vip"))
};
networkConfigurationSet.InputEndpoints.AddEndpoint(inputEndpoint);
}
}
return networkConfigurationSet;
}