Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DrawingPipeline"/> class.
        /// </summary>
        /// <param name="drawer">The general drawer.</param>
        /// <param name="runtime">Corresponding <see cref="RuntimeAssembly"/>.</param>
        /// <param name="result">The analysis result which instances will be drawn.</param>
        public DrawingPipeline(GeneralDrawer drawer, RuntimeAssembly runtime, AnalyzingResult result)
        {
            Runtime = runtime;
            _result = result;
            _drawer = drawer;

            var initialView = new EditView(_result.CreateExecutionView());

            Context = new DiagramDefinition(initialView);

            foreach (var edit in runtime.GlobalEdits)
            {
                var drawingEdit = CreateEditDefinition(edit);
                Context.AddEdit(drawingEdit);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Processes given edits on results view.
        /// </summary>
        /// <param name="runtime">The runtime.</param>
        /// <param name="result">The result.</param>
        /// <param name="editActions">The edit actions.</param>
        /// <returns>ExecutionView.</returns>
        private static ExecutionView processEdits(RuntimeAssembly runtime, AnalyzingResult result, IEnumerable <EditAction> editActions)
        {
            var view = result.CreateExecutionView();

            foreach (var editAction in editActions)
            {
                if (editAction.IsRemoveAction)
                {
                    view = processRemoveEdit(result, view, editAction);
                }
                else
                {
                    view = processInstanceEdit(runtime, result, view, editAction);
                }
            }
            view.Commit();
            return(view);
        }