Example #1
0
        public SimpleProxyPortOwner(IModel model, string name, Guid guid)
        {
            m_name  = name;
            m_sptpo = new SimplePassThroughPortOwner(model, name + ".internal", Guid.NewGuid());

            m_in  = new InputPortProxy(model, "In", null, Guid.NewGuid(), this, m_sptpo.In);
            m_out = new OutputPortProxy(model, "Out", null, Guid.NewGuid(), this, m_sptpo.Out);
        }
Example #2
0
        public void TestSimplePortNetwork()
        {
            for (int i = 0; i < m_nBlocks; i++)
            {
                m_blocks[i] = new SimplePassThroughPortOwner(m_model, "Block" + i, Guid.NewGuid());
                if (i > 0)
                {
                    ConnectorFactory.Connect(m_blocks[i - 1].Out, m_blocks[i].In);
                }
            }

            m_blocks[0].In.Put("Random string");
            Debug.WriteLine(m_blocks[m_nBlocks - 1].Out.Peek(null));


            Debug.WriteLine(m_blocks[m_nBlocks - 1].Out.Take(null));
        }