예제 #1
0
        internal Synchronizer(GraphController controller)
        {
            Validity.Assert(controller != null);

            this.controller        = controller;
            this.controller.Saved += new GraphSavedHandler(OnGraphSaved);

            // If we're running in NUnit, then the LiveRunner will not be created
            // since we do not yet have a way to test asynchronous calls and
            // their return values (and currently calls into LiveRunner
            // asynchronously creates some random failures in NUnit test cases).
            //
            if (null != CoreComponent.Instance.HostApplication)
            {
                this.runner                  = LiveRunnerFactory.CreateLiveRunner(controller);
                runner.GraphUpdateReady     += new GraphUpdateReadyEventHandler(OnRunnerGraphUpdateReady);
                runner.NodeValueReady       += new NodeValueReadyEventHandler(OnRunnerNodeValueReady);
                runner.NodesToCodeCompleted += new NodesToCodeCompletedEventHandler(OnNodesToCodeCompleted);
            }
            else
            {
#if false
                // This part of the code will be enabled .
                this.runner                  = LiveRunnerFactory.CreateLiveRunner(controller);
                runner.GraphUpdateReady     += OnNUnitGraphUpdateReady;
                runner.NodeValueReady       += OnNUnitNodeValueReady;
                runner.NodesToCodeCompleted += OnNUnitNodesToCodeCompleted;
#endif
            }
        }
예제 #2
0
        private void OnGraphSaved(object sender, EventArgs e)
        {
            if (null == this.runner) // Running in headless mode.
            {
                return;
            }
            GraphController controller = sender as GraphController;

            if (null != controller)
            {
                LiveRunner liveRunner = runner as LiveRunner;
                //Update the options with new path.
                liveRunner.SetOptions(LiveRunnerFactory.CreateLiveRunnerOptions(controller));
                GraphUtilities.SetRootModulePath(controller.FilePath);
            }
        }