Beispiel #1
0
        /// <summary>
        /// 
        /// </summary>
        private void InitializeContext()
        {
            this.SetStyle(
                ControlStyles.AllPaintingInWmPaint
                | ControlStyles.UserPaint
                | ControlStyles.DoubleBuffer
                | ControlStyles.SupportsTransparentBackColor,
                true);

            var context = new EditorContext()
            {
                View = this,
                Renderers = new IRenderer[] { new EmfRenderer(72.0 / 96.0) },
                ProjectFactory = new Default3D(),
                TextClipboard = new TextClipboard(),
                Serializer = new NewtonsoftSerializer(),
                PdfWriter = new PdfWriter(),
                DxfWriter = new DxfWriter(),
                CsvReader = new CsvHelperReader(),
                CsvWriter = new CsvHelperWriter()
            };

            context.Renderers[0].State.EnableAutofit = true;
            context.InitializeEditor(new TraceLog(), System.IO.Path.Combine(GetAssemblyPath(), _logFileName));
            context.Editor.Renderers[0].State.DrawShapeState.Flags = ShapeStateFlags.Visible;
            context.Editor.GetImageKey = async () => await GetImageKey();

            context.Invalidate = this.InvalidateContainer;

            DataContext = context;
        }
 /// <summary>
 /// Initializes a new instance of the Factory class.
 /// </summary>
 /// <param name="context"></param>
 public Factory(EditorContext context)
 {
     Context = context;
 }
Beispiel #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="context"></param>
 public ZoomState(EditorContext context)
 {
     _context = context;
 }