/* ----------------------------------------------------------------- */ /// /// Render (private) /// /// <summary> /// MEMO: ロックは暫定処理.Microsoft によると public にアクセス /// 可能なオブジェクトを用いた lock は想定していないらしい. /// http://msdn.microsoft.com/ja-jp/library/c5kehkcz%28VS.80%29.aspx /// </summary> /// /* ----------------------------------------------------------------- */ private static bool Render(Canvas canvas, bool adjust) { if (canvas == null) { return(false); } var engine = canvas.Tag as CanvasEngine; if (engine == null) { return(false); } var core = engine.Core; if (core == null) { return(false); } lock (core) { var status = core.RenderPage(IntPtr.Zero, false, false); if (status && adjust) { CanvasPolicy.Adjust(canvas); } canvas.Invalidate(); return(status); } }
/* ----------------------------------------------------------------- */ /// Adjust_WorkCompletedHandler /* ----------------------------------------------------------------- */ private static void Adjust_WorkCompletedHandler(object sender, RunWorkerCompletedEventArgs e) { var canvas = e.Result as Canvas; if (canvas == null) { return; } canvas.Cursor = Cursors.Default; CanvasPolicy.Adjust(canvas); canvas.Invalidate(); }