private void ControlsToData()
{
if (CapabilityMapMode)
{
if (lvList.Items.Count == 0)
{
if( _mapping != null )
_mapping.Map = null;
}
else
{
if (_mapping == null)
_mapping = new Mapping();
if (_mapping.Map == null)
_mapping.Map = new List<Network>();
_mapping.Map.Clear();
foreach (ListViewItem lvi in lvList.Items)
_mapping.Map.Add(lvi.Tag as Network);
}
}
else if (_hardwareItemDescription != null)
{
if (lvList.Items.Count == 0)
{
_hardwareItemDescription.NetworkList = null;
}
else
{
if (_hardwareItemDescription.NetworkList == null)
_hardwareItemDescription.NetworkList = new List<Network>();
_hardwareItemDescription.NetworkList.Clear();
foreach (ListViewItem lvi in lvList.Items)
_hardwareItemDescription.NetworkList.Add( lvi.Tag as Network );
}
}
}