ATMLCommonLibrary.controls.capability.CapabilityInterfaceListControl.AddPortsToListView C# (CSharp) Метод

AddPortsToListView() приватный Метод

private AddPortsToListView ( ) : void
Результат void
        private void AddPortsToListView()
        {
            lvPorts.Items.Clear();
            foreach (Port port in _interface.Ports)
            {
                AddPortToListView(port);
                string pathMap = GetCapabilityPortMapPath();
                List<Resource> resources = GetResources();
                if (resources != null && pathMap != null)
                {
                    //--- Find any mapped resource ports and add them to the port mapping ---//
                    String sourceName = String.Format(pathMap, _parentCapability.name, port.name);
                    foreach (Resource resource in resources)
                    {
                        if (resource.Interface != null && resource.Interface.Ports != null)
                        {
                            foreach (Port resourcePort in resource.Interface.Ports)
                            {
                                if (IsMappedToResourcePort(sourceName, resource, resourcePort))
                                {
                                    string key = resource.name + "." + resourcePort.name;
                                    if (!port.MappedPorts.ContainsKey(key))
                                        port.MappedPorts.Add(key, resourcePort);
                                    else
                                        port.MappedPorts[key] = resourcePort;
                                }
                            }
                        }
                    }
                }
            }
        }