private void btnMapNetwork_Click( object sender, EventArgs e )
{
var form = new NetworkPathSelectionForm( _hardwareItemDescription, CapabilityMapMode );
var nodePaths = new List<string>();
if (_networkNodes == null)
_networkNodes = new List<NetworkNode>();
foreach (NetworkNode networkNode in _networkNodes)
nodePaths.Add( networkNode.Path.Value );
form.CheckedNodePaths = nodePaths;
if (DialogResult.OK == form.ShowDialog())
{
nodePaths = form.CheckedNodePaths;
//--- Check for unchecked paths and remove them
RemoveUnselectedNodes( nodePaths );
//--- Check if there are any matched nodes - if so leave them alone so we don't delete the id and description if already set
//--- Check for new paths - create a edit instance and open form modeless to allow user to add an id and description
foreach (string nodePath in nodePaths)
{
if (!ListContainsValue( _networkNodes, nodePath ))
{
var node = new NetworkNode();
node.Path = new NetworkNodePath();
node.Path.Value = nodePath;
_networkNodes.Add( node );
}
}
//--- Reload the list view ---//
DataToControls();
}
}