- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
public class Xps2Slides
{
    private int MakeCollection(List<string> data)
    {
        ...
        CallGC();
        ...
    }
    private void bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
    {
        ...
        CallGC();
        ...
    }
    private void makeDeepZoomFiles(string png)
    {
        ...
        CallGC();
    }
    private string MakePNG(ref FrameworkElement fe, int pageNumber)
    {
        CallGC();
        ...
        CallGC();
        ...
    }
    private void doPNG(string outputPath, ref RenderTargetBitmap bmp)
    {
        ...
        CallGC();
        ...
    }
    private void CallGC()
    {
        GC.AddMemoryPressure(300000);// number was picked at random..
        GC.Collect();
        GC.WaitForPendingFinalizers();
        GC.WaitForFullGCComplete();
    }
}
                                 
        
            Кандидат на позицию программиста: "There are alot of samples on the internet of such similar code, but nothing that could be used for serially generating these collections on the fly without crashing with a memory overflow error or some other input output issue. I have resolved these problems in the file contained in the sample."
        
        
"Не там чисто где метут - а там где не сорят" :)
Весьма, оригинально.