public void updateImages(ImageAction action) { ImagesLayout oldLayout = mLayout; mLayout = mScreenComposer.GetNextLayout(); if (mLayout != null) { ImagesRows rows = mLayout.Rows; int i = 0; showRows(rows, 0, 0, Size.Height, Size.Width, action, ref i); for (int picture = i; picture < mPictures.Count; ++picture) { mPictures[picture].mPictureBox.Hide(); showNextImage(mPictures[picture], action, null); } } else { for (int picture = 0; picture < mPictures.Count; ++picture) { mPictures[picture].mPictureBox.Hide(); showNextImage(mPictures[picture], action, null); } } if (oldLayout != null) { oldLayout.Dispose(); } }
/// <summary> /// Does composition work /// </summary> void doWork() { while (!mCanceled) { StackableImage image = mImages.GetNext(); if (image == null) { break; } lock (mLayouts) { if (!addImage(image)) { ImagesLayout layout = new ImagesLayout(mLayoutSize.Width, mLayoutSize.Height); mLayouts.Add(layout); if (!layout.Add(image)) { // terrible error! Shouldn't happen! image.Dispose(); } mLayoutCreated.Set(); } } } mWorkDone = true; mLayoutCreated.Set(); }
void reuseLayout(ImagesLayout layout) { reuseRows(layout.Rows); }