private static void Main(string[] args) { var container = ContainerConfigure.Configure(); using (var scope = container.BeginLifetimeScope()) { var mainView = scope.Resolve <IView>(); mainView.Start(); } }
private static void Main() { var container = ContainerConfigure.Configure(); using (var scope = container.BeginLifetimeScope()) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(scope.Resolve <Form>()); } }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var container = ContainerConfigure.Configure(); var viewModel = container.Resolve <MainWindowViewModel>(); var mainWindow = new MainWindow { DataContext = viewModel }; mainWindow.Show(); }
public void SaveGraph_LoadGraph_ReturnsEqualGraph(int obstaclePercent, int[] graphParams) { var container = ContainerConfigure.Configure(); using (var scope = container.BeginLifetimeScope()) { var assembler = scope.Resolve <IGraphAssemble>(); var serializer = scope.Resolve <IGraphSerializer>(); IGraph deserialized; var graph = assembler.AssembleGraph(obstaclePercent, graphParams); using (var stream = new MemoryStream()) { serializer.SaveGraph(graph, stream); stream.Seek(0, SeekOrigin.Begin); deserialized = serializer.LoadGraph(stream); } Assert.AreEqual(graph, deserialized); Assert.AreNotSame(graph, deserialized); } }
public AssembleClassesTests() { var container = ContainerConfigure.Configure(); assembleClasses = container.Resolve <IAssembleClasses>(); }