예제 #1
0
        static void Main(string[] args)
        {
            // configure ioc
            var builder = new ContainerBuilder();

            IocConfiguration.Configure(builder);
            var container = builder.Build();

            var          menu   = new ApplicationMenu();
            DocumentType?option = null;

            // handle the menu loop until a non-selection is entered
            while ((option = menu.DocumentSelectionLoop()) != null)
            {
                // using Service location to get us started with the document type selection
                var stateEngine = container.Resolve <Func <DocumentType, StateEngine> >()(option.Value);
                menu.ActionLoop(stateEngine);
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            // configure ioc
            var builder = new ContainerBuilder();

            IocConfiguration.Configure(builder);
            var container = builder.Build();

            var menu = new ApplicationMenu();
            DocumentType? option = null;

            // handle the menu loop until a non-selection is entered
            while((option = menu.DocumentSelectionLoop())!= null)
            {
                // using Service location to get us started with the document type selection
                var stateEngine = container.Resolve<Func<DocumentType, StateEngine>>()(option.Value);
                menu.ActionLoop(stateEngine);
            }
        }