Beispiel #1
0
        private void BT_Run_Click(object sender, RoutedEventArgs e)
        {
            nodes = new List<Node>();

            foreach (var model in (App.Current as App).displaymodelList)
            {
                Node node = new Node(model.id, model.serviceChannelsNumber, model.queueMaxSize, model.checkoutTime, StringToIntList(model.systems));
                nodes.Add(node);
            }
            (App.Current as App).network = new Network(nodes);
            (App.Current as App).network.alpha = Convert.ToSingle(alpha);
            (App.Current as App).network.gamma = Convert.ToSingle(gamma);  

            (App.Current as App).percentage = percentLocal;
            Window1 win1 = new Window1();
            win1.Show();         
        }
Beispiel #2
0
        private void ButtonForCreateTournament_Click(object sender, RoutedEventArgs e)
        {
            Window1 CreateTour = new Window1();

            CreateTour.Show();
        }
Beispiel #3
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            Window1 window = new Window1(textBox.Text);

            window.Show();
        }
Beispiel #4
0
        public MainWindow()
        {
            EnsureBrowserEmulationEnabled();
            string fileName = "log.txt";
            string path     = System.IO.Path.Combine(Environment.CurrentDirectory, @"Logs\", fileName);

            System.IO.StreamWriter file = new System.IO.StreamWriter(path);
            DataContext = this;
            RotateTransform rotate = new RotateTransform(90);

            InitializeComponent();

            Rocket_Image.Source = new BitmapImage(new Uri(MainWindow.symbol_path + @"\Rocket_flipped_propane.png"));
            Glow_Plug.Source    = new BitmapImage(new Uri(MainWindow.symbol_path + @"\Glow_Plug\Glow_Plug_Off.png"));
            try
            {
                sp.Open();
            }
            catch (System.IO.IOException)
            {
                System.Windows.MessageBox.Show("Launch Keys Disconnected", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            //ensures that secondWindow is owned by MainWindow
            Window1 secondWindow = new Window1(this);

            SourceInitialized += (s, a) =>
            {
                secondWindow.Owner = this;
            };
            secondWindow.Show();
            var secondaryScreen = Screen.AllScreens.Where(s => !s.Primary).FirstOrDefault();

            if (secondaryScreen != null)
            {
                var workingArea = secondaryScreen.WorkingArea;
                secondWindow.Left   = workingArea.Left;
                secondWindow.Top    = workingArea.Top;
                secondWindow.Width  = workingArea.Width;
                secondWindow.Height = workingArea.Height;

                if (IsLoaded)
                {
                    secondWindow.WindowState = WindowState.Maximized;
                }
            }



            Graph.DataContext       = Graph_Object;
            Altitude.OnDataChanged += new DataObject.DataChanged(Graph_Object.OnDataChanged_Handler);


            DispatcherTimer timer = new DispatcherTimer();

            timer.Interval = TimeSpan.FromSeconds(.05);
            timer.Tick    += timer_Tick;
            timer.Start();

            synth.SetOutputToDefaultAudioDevice();
            client.connected = false;

            initObjects();
            initDataObjects();
        }