コード例 #1
0
ファイル: Program.cs プロジェクト: lanicon/PathFinding
        private static void Main(string[] args)
        {
            var container = ContainerConfigure.Configure();

            using (var scope = container.BeginLifetimeScope())
            {
                var mainView = scope.Resolve <IView>();
                mainView.Start();
            }
        }
コード例 #2
0
        private static void Main()
        {
            var container = ContainerConfigure.Configure();

            using (var scope = container.BeginLifetimeScope())
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(scope.Resolve <Form>());
            }
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        public AssembleClassesTests()
        {
            var container = ContainerConfigure.Configure();

            assembleClasses = container.Resolve <IAssembleClasses>();
        }