Ejemplo n.º 1
0
        /// <summary>
        /// Show composition based on analysis of given method.
        /// </summary>
        /// <param name="compositionPoint">Composition point to be analyzed.</param>
        private void showComposition(CompositionPoint compositionPoint)
        {
            _vs.SafeRunAction(() =>
            {
                if (_currentResult != null)
                {
                    //invalidate result, to free up resources
                    UserInteraction.DisposeResources();
                }

                if (compositionPoint == null)
                {
                    _guiManager.Display(null, true);
                    _currentResult = null;
                }
                else
                {
                    var watch = Stopwatch.StartNew();

                    runAnalysis(compositionPoint);
                    _vs.Log.Message("Executing composition point {0}ms", watch.ElapsedMilliseconds);

                    if (_analysisError == null)
                    {
                        watch.Restart();

                        //analysis has been successful
                        var drawing = createDrawings(_currentResult);
                        _guiManager.Display(drawing);
                        _vs.Log.Message("Drawing composition point {0}ms", watch.ElapsedMilliseconds);
                    }
                    else
                    {
                        _guiManager.DisplayEntry(_analysisError);
                    }
                }
            }, "Refreshing composition point");
        }