Пример #1
0
        public void AddConfiguredPort(PortInfo portInfo, bool writeToDisk=true)
        {

            //we always lock configuredPorts even if unconfiguredPorts is being touched

            lock (configuredPorts)
            {
                //remove from uncofigured list first if it exists there

                if (unconfiguredPorts.ContainsKey(portInfo))
                    unconfiguredPorts.Remove(portInfo);

                configuredPorts.Add(portInfo, portInfo);
                configuredPortNames.Add(portInfo.GetFriendlyName(), portInfo);

                foreach (VRole role in portInfo.GetRoles())
                {
                    if (!configuredRolesInHome.ContainsKey(role))
                        configuredRolesInHome[role] = true;
                }

                if (writeToDisk) 
                    WriteServicesList();
            }

        }
Пример #2
0
        public List<ModuleInfo> GetCompatibleModules(PortInfo portInfo)
        {
            var retList = new List<ModuleInfo>();

            foreach (VRole role in portInfo.GetRoles())
            {
                var roleCompatibleModules = GetCompatibleModules(role);

                foreach (var mInfo in roleCompatibleModules)
                {
                    if (!retList.Contains(mInfo))
                        retList.Add(mInfo);
                }
            }

            return retList;
        }