예제 #1
0
        /// <summary>
        /// Run concrete drawing of instance.
        /// </summary>
        /// <param name="instance">The drawn instance.</param>
        private void concreteDrawing(DrawedInstance instance)
        {
            var drawer = Runtime.GetDrawer(instance.WrappedInstance);

            if (drawer != null)
            {
                drawer.Draw(instance);
            }
        }
예제 #2
0
        /// <summary>
        /// Gets instance drawing.
        /// </summary>
        /// <param name="instance">The instance which drawing is requested.</param>
        /// <returns>Instance drawing.</returns>
        private DrawedInstance getDrawing(Instance instance)
        {
            DrawedInstance result;

            if (!_instanceDrawings.TryGetValue(instance, out result))
            {
                var runtimeTypeDefinition = Runtime.GetTypeDefinition(instance);

                result = new DrawedInstance(runtimeTypeDefinition, instance, this);
                _instanceDrawings[instance] = result;

                _toDrawQueue.Enqueue(result);
            }

            return(result);
        }
예제 #3
0
 /// <summary>
 /// Run general drawing of instance.
 /// </summary>
 /// <param name="instance">The instance.</param>
 private void generalDrawing(DrawedInstance instance)
 {
     _drawer(instance);
 }
예제 #4
0
 /// <summary>
 /// Draws the specified item for given instance.
 /// </summary>
 /// <param name="instance">Instance which is represented by given drawing item</param>
 /// <param name="item">Item drawing.</param>
 internal void DrawItem(DrawedInstance instance, DiagramItemDefinition item)
 {
     Context.DrawItem(item);
     _displayedInstances.Add(instance.WrappedInstance);
 }