本文整理汇总了C#中DocumentWorkspace.Update方法的典型用法代码示例。如果您正苦于以下问题:C# DocumentWorkspace.Update方法的具体用法?C# DocumentWorkspace.Update怎么用?C# DocumentWorkspace.Update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocumentWorkspace
的用法示例。
在下文中一共展示了DocumentWorkspace.Update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PerformAction
public override HistoryMemento PerformAction(DocumentWorkspace documentWorkspace)
{
DateTime lastUpdate = DateTime.Now;
documentWorkspace.History.BeginStepGroup();
using (new WaitCursorChanger(documentWorkspace))
{
documentWorkspace.SuspendToolCursorChanges();
while (documentWorkspace.History.RedoStack.Count > 0)
{
documentWorkspace.History.StepForward();
if ((DateTime.Now - lastUpdate).TotalMilliseconds >= 500)
{
documentWorkspace.History.EndStepGroup();
documentWorkspace.Update();
lastUpdate = DateTime.Now;
documentWorkspace.History.BeginStepGroup();
}
}
documentWorkspace.ResumeToolCursorChanges();
}
documentWorkspace.History.EndStepGroup();
Utility.GCFullCollect();
documentWorkspace.Document.Invalidate();
documentWorkspace.Update();
return null;
}
示例2: PerformAction
public override HistoryMemento PerformAction(DocumentWorkspace documentWorkspace)
{
if (!ScanningAndPrinting.CanPrint)
{
Utility.ShowWiaError(documentWorkspace);
return null;
}
using (new PushNullToolMode(documentWorkspace))
{
// render image to a bitmap, save it to disk
Surface scratch = documentWorkspace.BorrowScratchSurface(this.GetType().Name + ".PerformAction()");
try
{
scratch.Clear();
RenderArgs ra = new RenderArgs(scratch);
documentWorkspace.Update();
using (new WaitCursorChanger(documentWorkspace))
{
ra.Surface.Clear(ColorBgra.White);
documentWorkspace.Document.Render(ra, false);
}
string tempName = Path.GetTempFileName() + ".bmp";
ra.Bitmap.Save(tempName, ImageFormat.Bmp);
try
{
ScanningAndPrinting.Print(documentWorkspace, tempName);
}
catch (Exception ex)
{
Utility.ShowWiaError(documentWorkspace);
Tracing.Ping(ex.ToString());
// TODO: do a "better" error dialog here
}
// Try to delete the temp file but don't worry if we can't
bool result = FileSystem.TryDeleteFile(tempName);
}
finally
{
documentWorkspace.ReturnScratchSurface(scratch);
}
}
return null;
}
示例3: PerformAction
public override HistoryMemento PerformAction(DocumentWorkspace documentWorkspace)
{
if (documentWorkspace.History.RedoStack.Count > 0)
{
if (!(documentWorkspace.History.RedoStack[documentWorkspace.History.RedoStack.Count - 1] is NullHistoryMemento))
{
using (new WaitCursorChanger(documentWorkspace.FindForm()))
{
documentWorkspace.History.StepForward();
documentWorkspace.Update();
}
}
Utility.GCFullCollect();
}
return null;
}