Пример #1
0
        private void AddDrawing(PointF imagePoint, int keyframeIndex, int timestampPerFrame, ImageToViewportTransformer transformer)
        {
            AbstractDrawing drawing    = screenToolManager.ActiveTool.GetNewDrawing(imagePoint, keyframeIndex, timestampPerFrame, transformer);
            Guid            keyframeId = metadata.GetKeyframeId(keyframeIndex);

            HistoryMementoAddDrawing memento = new HistoryMementoAddDrawing(metadata, keyframeId, drawing.Id, drawing.ToolDisplayName);

            metadata.AddDrawing(keyframeId, drawing);
            metadata.HistoryStack.PushNewCommand(memento);

            // Special cases
            // TODO: implement the event handler to metadata DrawingAdded and finish the label in the handler.
            if (screenToolManager.ActiveTool == ToolManager.Tools["Label"])
            {
                if (LabelAdded != null)
                {
                    LabelAdded(this, new DrawingEventArgs(drawing, keyframeId));
                }

                ((DrawingText)drawing).SetEditMode(true, transformer);
            }
        }