Beispiel #1
0
        //-------------------------------------------------------------
        private void KobberLan_Load(object sender, EventArgs e)
        //-------------------------------------------------------------
        {
            //-------------------------------------------------------------
            //Check if computer has multiple network interfaces
            //-------------------------------------------------------------
            chooseNetworkInterface = new ChooseNetworkInterface();
            if (chooseNetworkInterface.GetActiveNetworkInterfaces().Count > 1)
            {
                //-------------------------------------------------------------
                //Only show dialog if more than 1 network interfaces
                //-------------------------------------------------------------
                chooseNetworkInterface.ShowDialog();
            }

            //-------------------------------------------------------------
            //Init default values
            //-------------------------------------------------------------
            notifyIcon1.Text    = "KobberLan";
            notifyIcon1.Visible = true;
            broadcast           = new Broadcast(this);
            communication       = new Communication(this);

            //-------------------------------------------------------------
            // Start start icon (0 found)
            //-------------------------------------------------------------
            SetIconNumber(0);

            //-------------------------------------------------------------
            //Start server listening for broadcast
            //-------------------------------------------------------------
            broadcast.ServerStartListeningBroadCast();

            //-------------------------------------------------------------
            //Start server listening for Communication
            //-------------------------------------------------------------
            communication.ServerStartListening();

            //-------------------------------------------------------------
            //Show ports
            //-------------------------------------------------------------
            //label_PortBroadcast.Text = "Broadcast {" + Broadcast.BROADCAST_PORT +"} UDP";
            //label_CommPort.Text = "Comm {" + Communication.COMMUNICATION_PORT + "} TCP";
            //label_TorrentPort.Text = "Torrent {" + Torrent.TRACKERUDP_PORT + "} UDP";

            //-------------------------------------------------------------
            //Start client broadcast timer
            //-------------------------------------------------------------
            BroadCastTimer.Start();

            //-------------------------------------------------------------
            //Add default usercontrol with SuggestGame button
            //-------------------------------------------------------------
            OverviewControl overviewControl = new OverviewControl(this);

            flowLayoutPanel_SuggestedGames.Controls.Add(overviewControl);
        }
Beispiel #2
0
        public void OnLoaded(object sender, RoutedEventArgs e)
        {
            testControl     = new TestControl(this);
            overviewControl = new OverviewControl(this);
            generalControl  = new GeneralControl(this);
            databaseControl = new DatabaseControl(this);
            settingsControl = new SettingsControl(this);
            advancedControl = new AdvancedControl(this);

            contentControl.Content = generalControl;
        }
            void IDocument.Show()
            {
                OverviewControl overview = new OverviewControl();

                form.MinimizeBox     = false;
                form.MaximizeBox     = false;
                form.FormBorderStyle = FormBorderStyle.FixedDialog;
                form.Text            = captionText;
                form.ClientSize      = overview.Size;
                form.MinimumSize     = form.Size;
                overview.SetDescription(descriptionText);
                overview.Dock      = DockStyle.Fill;
                overview.Parent    = form;
                form.StartPosition = FormStartPosition.CenterParent;
                form.Icon          = AppHelper.AppIcon;
                using (form) {
                    form.ShowDialog(AppHelper.MainForm);
                }
            }