예제 #1
0
        /// <summary>
        ///
        /// </summary>
        private void InitializeContext()
        {
            _context = new Test2d.EditorContext()
            {
                View           = this,
                Renderers      = new Test2d.IRenderer[] { new EtoRenderer(72.0 / 96.0) },
                ProjectFactory = new Test2d.ProjectFactory(),
                TextClipboard  = new TextClipboard(),
                Serializer     = new Test2d.NewtonsoftSerializer(),
                PdfWriter      = new Test2d.PdfWriter(),
                DxfWriter      = new Test2d.DxfWriter(),
                CsvReader      = new Test2d.CsvHelperReader(),
                CsvWriter      = new Test2d.CsvHelperWriter()
            };
            _context.InitializeEditor(new Test2d.TraceLog(), "Test2d.log");
            _context.Editor.Renderers[0].State.DrawShapeState.Flags = Test2d.ShapeStateFlags.Visible;
            _context.Editor.GetImageKey = async() => await GetImageKey();

            _context.Invalidate = this.UpdateAndInvalidate;

            _state = new Test2d.ZoomState(_context, this.UpdateAndInvalidate);

            DataContext = _context;
        }
예제 #2
0
        /// <summary>
        /// 
        /// </summary>
        private void InitializeContext()
        {
            _context = new Test2d.EditorContext()
            {
                View = this,
                Renderers = new Test2d.IRenderer[] { new EtoRenderer(72.0 / 96.0) },
                ProjectFactory = new Test2d.ProjectFactory(),
                TextClipboard = new TextClipboard(),
                Serializer = new Test2d.NewtonsoftSerializer(),
                PdfWriter = new Test2d.PdfWriter(),
                DxfWriter = new Test2d.DxfWriter(),
                CsvReader = new Test2d.CsvHelperReader(),
                CsvWriter = new Test2d.CsvHelperWriter()
            };
            _context.InitializeEditor(new Test2d.TraceLog());
            _context.Editor.Renderers[0].State.DrawShapeState = Test2d.ShapeState.Visible;
            _context.Editor.GetImageKey = async () => await GetImageKey();

            _context.Invalidate = this.UpdateAndInvalidate;

            _state = new Test2d.ZoomState(_context, this.UpdateAndInvalidate);

            DataContext = _context;
        }