Пример #1
0
        private void buttonStart_Click(object sender, RoutedEventArgs e)
        {
            InstanceSettings instanceSettings = new InstanceSettings()
            {
                UseVLAN = checkBoxUseVLAN.IsChecked.Value
            };

            var mainWindow = new MainWindow(instanceSettings);

            mainWindow.Show();

            this.Close();
        }
Пример #2
0
        public MainWindow(InstanceSettings settings)
        {
            InitializeComponent();

            switchEngine = new SwitchEngine(6);
            if (settings.UseVLAN)
            {
                GameEngine.RandomizeSwitchPortsVlan(switchEngine);
            }
            gameEngine = new GameEngine(switchEngine);

            switchEngine[0].AttachToGrid(mainGrid, 10, 10, settings.UseVLAN);
            switchEngine[1].AttachToGrid(mainGrid, 10, 180, settings.UseVLAN);
            switchEngine[2].AttachToGrid(mainGrid, 10, 350, settings.UseVLAN);
            switchEngine[3].AttachToGrid(mainGrid, 600, 10, settings.UseVLAN);
            switchEngine[4].AttachToGrid(mainGrid, 600, 180, settings.UseVLAN);
            switchEngine[5].AttachToGrid(mainGrid, 600, 350, settings.UseVLAN);

            this.Title += $" {Assembly.GetEntryAssembly().GetName().Version}";
        }