Пример #1
0
        private void CreateStaticExtraDrawings()
        {
            // Add the static extra drawings.
            // These drawings are unique and not attached to any particular key image.

            spotlightManager        = new SpotlightManager();
            autoNumberManager       = new AutoNumberManager(ToolManager.GetStylePreset("AutoNumbers"));
            drawingCoordinateSystem = new DrawingCoordinateSystem(Point.Empty, ToolManager.GetStylePreset("CoordinateSystem"));
            drawingTestGrid         = new DrawingTestGrid();

            extraDrawings.Add(spotlightManager);
            extraDrawings.Add(autoNumberManager);
            extraDrawings.Add(drawingCoordinateSystem);
            extraDrawings.Add(drawingTestGrid);

            // totalStaticExtraDrawings is used to differenciate between static extra drawings like multidrawing managers
            // and dynamic extra drawings like tracks and chronos.
            totalStaticExtraDrawings = extraDrawings.Count;

            spotlightManager.TrackableDrawingAdded += (s, e) =>
            {
                if (AddTrackableDrawingCommand != null)
                {
                    AddTrackableDrawingCommand.Execute(e.TrackableDrawing);
                }
            };

            spotlightManager.TrackableDrawingDeleted += (s, e) => DeleteTrackableDrawing(e.TrackableDrawing);
        }