Beispiel #1
0
 public static void SetListViewHeader(MainForm form)
 {
     form.listView.Columns.Add("Server");
     form.listView.Columns.Add("DNS/IP");
     form.listView.Columns.Add("Game");
     form.listView.Columns.Add("Genre");
     form.listView.View = View.Details;
 }
Beispiel #2
0
        public static void SetServer(Server server, MainForm form)
        {
            form.treeView.Nodes[server.GetGame().GetGameName()].Nodes.Add(server.GetServerName() + " " + server.GetDnsIP());
            form.treeView.ExpandAll();

            string[] row = { server.GetServerName(), server.GetDnsIP(), server.GetGame().GetGameName(), server.GetGame().GetGameGenre() };
            ListViewItem lvi = new ListViewItem(row);
            form.listView.Items.Add(lvi);
        }
Beispiel #3
0
        public void tracker(Server s, MainForm form)
        {
            form.notifyIconTray.ShowBalloonTip(300,"Connected to"+s.GetServerName(),"Ping is"+" "+Commands.pingHost(s.GetDnsIP()),ToolTipIcon.Info);
            while (!_Disable)
            {

                int ping = Commands.pingHost(s.GetDnsIP());
                if (ping < 150 && ping >= 0)
                    form.notifyIconTray.Icon = new Icon("Resources/iconG.ico");
                else if (ping < 400 && ping >=150)
                    form.notifyIconTray.Icon = new Icon("Resources/iconY.ico");
                else if (ping >= 400)
                    form.notifyIconTray.Icon = new Icon("Resources/iconR.ico");
                else
                    form.notifyIconTray.Icon = new Icon("Resources/icon404.ico");

                if(ping>=0)
                    form.notifyIconTray.Text = s.GetServerName().ToUpper() + " " + s.GetDnsIP() + "\n" + ping + "ms"+" "+s.GetGame().GetGameName();
                else
                    form.notifyIconTray.Text = s.GetServerName().ToUpper() + " " + s.GetDnsIP() + "\n" + "Host Unreachable" + " " + s.GetGame().GetGameName();

                System.Threading.Thread.Sleep(2000);
            }
        }
Beispiel #4
0
 public static void SetGame(Game game, MainForm form)
 {
     Arrays.games.Add(game);
     form.treeView.Nodes.Add(game.GetGameName(), game.GetGameName());
 }
Beispiel #5
0
 public void Disable(MainForm form)
 {
     _Disable = true;
     form.notifyIconTray.Icon = new Icon("Resources/icon404.ico");
     form.notifyIconTray.Text = "Server not Selected";
 }