Exemplo n.º 1
0
        private void CreatePage()
        {
            ++_pagesCounter;
            Console.Out.WriteLine("");
            Console.Out.WriteLine($"Creating page {_pagesCounter}");

            var pageLifetime = _lifetime.CreateLifetime();

            _pageFactory.Create(pageLifetime, $"Page{_pagesCounter}");
            _lifetimes.Add(_pagesCounter, pageLifetime);
        }
Exemplo n.º 2
0
 // Creates a similar lifetime to use with generic instances
 public ILifetime CreateLifetime() => new MySingletonLifetime(_baseSingletonLifetime.CreateLifetime(), _counter);