System.Action.Invoke(XLWorkbook)

Here are the examples of the csharp api System.Action.Invoke(XLWorkbook) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 Source : XlsxTemplateTestsBase.cs
with MIT License
from ClosedXML

protected void XlTemplateTest(string tmplFileName, Action<XLTemplate> arrangeCallback, Action<XLWorkbook> replacedertCallback)
        {
            /*if (MemoryProfiler.IsActive && MemoryProfiler.CanControlAllocations)
                MemoryProfiler.EnableAllocations();*/

            //MemoryProfiler.Dump();

            var fileName = Path.Combine(TestConstants.TemplatesFolder, tmplFileName);
            using (var stream = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            using (var template = new XLTemplate(stream))
            {
                // ARRANGE
                arrangeCallback(template);

                using (var file = new MemoryStream())
                {
                    //MemoryProfiler.Dump();
                    // ACT
                    var start = DateTime.Now;
                    template.Generate();
                    Output.WriteLine(DateTime.Now.Subtract(start).ToString());
                    //MemoryProfiler.Dump();
                    template.SaveAs(file);
                    //MemoryProfiler.Dump();
                    file.Position = 0;

                    using (var wb = new XLWorkbook(file))
                    {
                        // replacedERT
                        replacedertCallback(wb);
                    }
                }
            }

            GC.Collect();
            //MemoryProfiler.Dump();
        }