Esempio n. 1
0
 internal static Flow ConnectStartFilterEnd(TaskNode s, TaskNode filter, TaskNode n)
 {
     Flow flow = new Flow();
     flow.AddNode(s);
     flow.AddNode(filter);
     flow.AddNode(n);
     flow.ConnectNodes(s, filter, 0);
     flow.ConnectNodes(filter, n, 0);
     flow.Error += new EventHandler<Flow.ErrorEventArgs>(flow_Error);
     return flow;
 }
Esempio n. 2
0
        internal static Flow ConnectStartFilterEnd(TaskNode s, TaskNode filter, TaskNode n)
        {
            Flow flow = new Flow();

            flow.AddNode(s);
            flow.AddNode(filter);
            flow.AddNode(n);
            flow.ConnectNodes(s, filter, 0);
            flow.ConnectNodes(filter, n, 0);
            flow.Error += new EventHandler <Flow.ErrorEventArgs>(flow_Error);
            return(flow);
        }
Esempio n. 3
0
 public void ConnectingPolymorphicTypes()
 {
     StartPoint<B> s = new StartPoint<B>((IWritableQueue<B> q) => q.Send(new B()));
     EndPoint<A> e = new EndPoint<A>((A q) => { });
     Flow flow = new Flow();
     flow.AddNode(s);
     flow.AddNode(e);
     flow.ConnectNodes(s, e, 0);
 }
Esempio n. 4
0
        public void ConnectingPolymorphicTypes()
        {
            StartPoint <B> s    = new StartPoint <B>((IWritableQueue <B> q) => q.Send(new B()));
            EndPoint <A>   e    = new EndPoint <A>((A q) => { });
            Flow           flow = new Flow();

            flow.AddNode(s);
            flow.AddNode(e);
            flow.ConnectNodes(s, e, 0);
        }
Esempio n. 5
0
        public void ConnectingWrongTypesThrows()
        {
            List<string> results = new List<string>();
            StartPoint<int> s = Helpers.GetStartpointCounter(1, 15);
            EndPoint<string> n = Helpers.GetEndpoint(results);

            Flow flow = new Flow();
            flow.AddNode(s);
            flow.AddNode(n);
            try
            {
                flow.ConnectNodes(s, n, 0);
                Assert.Fail("Connecting nodes of different types should throw invalid operation exception");
            }
            catch (InvalidOperationException)
            { }
        }
Esempio n. 6
0
        public void ConnectingWrongTypesThrows()
        {
            List <string>     results = new List <string>();
            StartPoint <int>  s       = Helpers.GetStartpointCounter(1, 15);
            EndPoint <string> n       = Helpers.GetEndpoint(results);

            Flow flow = new Flow();

            flow.AddNode(s);
            flow.AddNode(n);
            try
            {
                flow.ConnectNodes(s, n, 0);
                Assert.Fail("Connecting nodes of different types should throw invalid operation exception");
            }
            catch (InvalidOperationException)
            { }
        }