Example #1
0
        void CasterFlash_OnGetPorts(CapeCollection ports)
        {
            int emptyPort = 0;

            foreach (var pair in ports)
            {
                if (!pair.Value.ComponentName.StartsWith("feed"))
                {
                    continue;
                }
                CapeMaterialPort port = (CapeMaterialPort)pair.Value;
                if (!port.IsConnected())
                {
                    emptyPort++;
                }
                //if (emptyPort > 1)    //This will cause load fail in Aspen
                //{
                //    Ports.Remove(pair);
                //    emptyPort--;
                //}
            }
            if (emptyPort == 0)
            {
                int i = 0;
                while (ports.Contains("feed-" + i))
                {
                    i++;
                }
                ports.Add(new CapeMaterialPort("feed-" + i, CapePortDirection.CAPE_INLET));
            }
        }
 public void ContainsTest()
 {
     Assert.AreEqual(true, collection.Contains("real"));
     Assert.AreEqual(false, collection.Contains("real2"));
     Assert.AreEqual(false, collection.Contains((string)null));
 }