private void CloseWorkspace(AppWorkspace appWorkspace, DocumentWorkspace dw) { if (dw != null) { if (dw.Document == null) { appWorkspace.RemoveDocumentWorkspace(dw); } else if (!dw.Document.Dirty) { appWorkspace.RemoveDocumentWorkspace(dw); } else { appWorkspace.ActiveDocumentWorkspace = dw; TaskButton button = new TaskButton(PdnResources.GetImageResource("Icons.MenuFileSaveIcon.png").Reference, PdnResources.GetString("CloseWorkspaceAction.SaveButton.ActionText"), PdnResources.GetString("CloseWorkspaceAction.SaveButton.ExplanationText")); TaskButton button2 = new TaskButton(PdnResources.GetImageResource("Icons.MenuFileCloseIcon.png").Reference, PdnResources.GetString("CloseWorkspaceAction.DontSaveButton.ActionText"), PdnResources.GetString("CloseWorkspaceAction.DontSaveButton.ExplanationText")); TaskButton button3 = new TaskButton(PdnResources.GetImageResource("Icons.CancelIcon.png").Reference, PdnResources.GetString("CloseWorkspaceAction.CancelButton.ActionText"), PdnResources.GetString("CloseWorkspaceAction.CancelButton.ExplanationText")); string str = PdnResources.GetString("CloseWorkspaceAction.Title"); string str3 = string.Format(PdnResources.GetString("CloseWorkspaceAction.IntroText.Format"), dw.GetFileFriendlyName()); int thumbEdgeLength = UIUtil.ScaleWidth(80); SizeInt32 num = ThumbnailHelpers.ComputeThumbnailSize(dw.Document.Size(), thumbEdgeLength); SizeInt32 fullThumbSize = new SizeInt32(num.Width + 4, num.Height + 4); bool animating = true; Image finalThumb = null; Action <Image> animationEvent = null; Image[] busyAnimationFrames = AnimatedResources.Working; Image[] busyAnimationThumbs = new Image[busyAnimationFrames.Length]; int animationHz = 50; Stopwatch timing = new Stopwatch(); timing.Start(); long elapsedTicks = timing.ElapsedTicks; using (System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer()) {