public test_sync_with_dialog_win()
        {
            InitializeComponent();

            var frc = new FlowRuntimeConfiguration();
            frc.AddStream(new Stream(".inMakeSync", "gettime"));
            frc.AddStream(new Stream("gettime", "showtimeMakeSync"));
            frc.AddStream(new Stream(".inAttribute", "gettime2"));
            frc.AddStream(new Stream("gettime2", "showtimeAttribute"));
            frc.AddStream(new Stream(".inEbc", "gettime3"));
            frc.AddStream(new Stream("gettime3", "ebc.showtimeAttribute"));

            var opcont = new FlowRuntimeConfiguration();
            opcont.AddFunc("gettime", () => DateTime.Now);
            opcont.AddFunc("gettime2", () => DateTime.Now);
            opcont.AddFunc("gettime3", () => DateTime.Now);
            opcont.AddAction<DateTime>("showtimeMakeSync", (DateTime _) =>
                                                       {
                                                           Console.WriteLine("event handler thread: {0}",
                                                                             Thread.CurrentThread.GetHashCode());
                                                           label1.Text = _.ToString();
                                                           listBox1.Items.Add(_.ToString());
                                                       })
                  .MakeDispatched();
            opcont.AddAction<DateTime>("showtimeAttribute", this.ShowTimeAttribute);
            opcont.AddEventBasedComponent("ebc", this);

            frc.AddOperations(opcont.Operations);

            _fr = new FlowRuntime(frc);
            _fr.UnhandledException += Console.WriteLine;
        }
Example #2
0
        public test_sync_with_dialog_win()
        {
            InitializeComponent();

            var frc = new FlowRuntimeConfiguration();

            frc.AddStream(new Stream(".inMakeSync", "gettime"));
            frc.AddStream(new Stream("gettime", "showtimeMakeSync"));
            frc.AddStream(new Stream(".inAttribute", "gettime2"));
            frc.AddStream(new Stream("gettime2", "showtimeAttribute"));
            frc.AddStream(new Stream(".inEbc", "gettime3"));
            frc.AddStream(new Stream("gettime3", "ebc.showtimeAttribute"));

            var opcont = new FlowRuntimeConfiguration();

            opcont.AddFunc("gettime", () => DateTime.Now);
            opcont.AddFunc("gettime2", () => DateTime.Now);
            opcont.AddFunc("gettime3", () => DateTime.Now);
            opcont.AddAction <DateTime>("showtimeMakeSync", (DateTime _) =>
            {
                Console.WriteLine("event handler thread: {0}",
                                  Thread.CurrentThread.GetHashCode());
                label1.Text = _.ToString();
                listBox1.Items.Add(_.ToString());
            })
            .MakeDispatched();
            opcont.AddAction <DateTime>("showtimeAttribute", this.ShowTimeAttribute);
            opcont.AddEventBasedComponent("ebc", this);

            frc.AddOperations(opcont.Operations);

            _fr = new FlowRuntime(frc);
            _fr.UnhandledException += Console.WriteLine;
        }
        public OperationHost(IFlowRuntime runtime, IHostStub hostStub, IStandInProxy standInProxy)
        {
            _hostStub = hostStub;
            _standInProxy = standInProxy;

            _translator = new HostTranslator();

            hostStub.ReceivedFromStandIn += _translator.Process_remote_input;
            _translator.Translated_input += runtime.Process;
            runtime.Result += _translator.Process_local_output;
            _translator.Translated_output += standInProxy.SendToStandIn;
        }
Example #4
0
        public OperationHost(IFlowRuntime runtime, IHostStub hostStub, IStandInProxy standInProxy)
        {
            _hostStub     = hostStub;
            _standInProxy = standInProxy;

            _translator = new HostTranslator();

            hostStub.ReceivedFromStandIn += _translator.Process_remote_input;
            _translator.Translated_input += runtime.Process;
            runtime.Result += _translator.Process_local_output;
            _translator.Translated_output += standInProxy.SendToStandIn;
        }
        public test_sync_with_dialog_win()
        {
            InitializeComponent();

            var frc = new FlowRuntimeConfiguration();
            frc.AddStream(new Stream(".in", "gettime"));
            frc.AddStream(new Stream("gettime", "showtime"));

            var opcont = new FlowRuntimeConfiguration();
            opcont.AddFunc("gettime", () => DateTime.Now);
            opcont.AddAction<DateTime>("showtime", (DateTime _) =>
                                                       {
                                                           Console.WriteLine("event handler thread: {0}",
                                                                             Thread.CurrentThread.GetHashCode());
                                                           label1.Text = _.ToString();
                                                           listBox1.Items.Add(_.ToString());
                                                       })
                  .MakeSync();

            frc.AddOperations(opcont.Operations);

            _fr = new FlowRuntime(frc);
        }
Example #6
0
 public OperationHost CreateOperationHost(IFlowRuntime runtime, string name)
 {
     var trans = RegisterHost(name);
     return new OperationHost(runtime, trans, trans);
 }
        public PubnubOperationHost(IFlowRuntime runtime, PubnubCredentials credentials, string channel)
        {
            var transceiver = new PubnubHostTransceiver(credentials, channel);

            _operationHost = new OperationHost(runtime, transceiver, transceiver);
        }
Example #8
0
        public OperationHost CreateOperationHost(IFlowRuntime runtime, string name)
        {
            var trans = RegisterHost(name);

            return(new OperationHost(runtime, trans, trans));
        }
 public PubnubOperationHost(IFlowRuntime runtime, PubnubCredentials credentials, string channel)
 {
     var transceiver = new PubnubHostTransceiver(credentials, channel);
     _operationHost = new OperationHost(runtime, transceiver, transceiver);
 }
        public WcfOperationHost(IFlowRuntime runtime, string endpointAddress)
        {
            var transceiver = new WcfHostTransceiver(endpointAddress);

            _operationHost = new OperationHost(runtime, transceiver, transceiver);
        }
Example #11
0
 public WcfOperationHost(IFlowRuntime runtime, string endpointAddress)
 {
     var transceiver = new WcfHostTransceiver(endpointAddress);
     _operationHost = new OperationHost(runtime, transceiver, transceiver);
 }