public void Method1() { Array myPixels = (...); while (true) { lock (pixelsLock) { //Max a local copy Array.Copy(sourceArray: shared, destinationArray: myPixels, length: myPixels.GetUpperBound(0) - 1); } DisplayWrapper.USBD480_DrawFullScreenBGRA32(ref disp, myPixels); } }
private void ParsePage(TimeReactionBase scene) { if (scene is null) { return; } DisplayWrapper eventResult = scene.RunEvent(isIdleTime, idleHours > 0); if (DisplayWrapper.IsNullOrEmpty(eventResult)) { return; } else if (eventResult.isSimpleReaction) { currentContentPage.OutputText(eventResult.simpleReaction); } else { DisplayBase display = eventResult.fullPageReaction; if (!string.IsNullOrEmpty(newHourHeader)) { display.CombineWith(newHourHeader, false); newHourHeader = null; } //enqueue the current page. create a new page, and load that. if (ReferenceEquals(display, GetCurrentPage())) { activePages.Enqueue(display); SetCurrentPage(pageMaker()); } else { GetCurrentPage().ClearOutput(); } } }