Exemplo n.º 1
0
        private void UpdateGui_FormMainLayout()
        {
            // update text box
            NetworkDetector nd = m_appManagerRef.Detector;
            string          ui = "[" + Utils.GetDateTime() + "]"
                                 + Environment.NewLine + Environment.NewLine;

            ui += "Network Status: ";
            if (nd.IsNetworkActive())
            {
                ui += "Active" + Environment.NewLine + Environment.NewLine;
                ui += "Network Adapter ID . . : " + nd.ActiveNetworkId()
                      + Environment.NewLine;
                ui += "Network Adapter Name . : " + nd.ActiveNetworkName()
                      + Environment.NewLine;
                ui += "Network Adapter Desc . : " + nd.ActiveNetworkDescription()
                      + Environment.NewLine;
                ui += "IP Address . . . . . . : " + nd.ActiveNetworkIPAddress()
                      + Environment.NewLine;
                ui += "Subnet Mask. . . . . . : " + nd.ActiveNetworkSubMask()
                      + Environment.NewLine;
                ui += "Default Gateway. . . . : " + nd.ActiveNetworkGateway()
                      + Environment.NewLine;
                ui += "DNS Server . . . . . . : " + nd.ActiveNetworkDnsAddress()
                      + Environment.NewLine;
                ui += "DNS Suffix . . . . . . : " + nd.ActiveNetworkDnsSuffix()
                      + Environment.NewLine;
            }
            else
            {
                ui += "Inactive" + Environment.NewLine;
            }
            tbStatus.Text = ui;

            // update label text
            labelProxyAddr.Text = "Proxy Server: "
                                  + (IeProxyOptions.ProxyEnable ? IeProxyOptions.ProxyAddr : "Disabled");

            // update group box title
            gbWorkMode.Text = "Work Mode: "
                              + m_appManagerRef.CurrWorkMode
                              + " Mode";

            // set focus
            tbStatus.Select(0, -1);
            btnRefresh.Focus();
        }
Exemplo n.º 2
0
        public AppManager(string appDir)
        {
            Logger.V(">> AppManager.AppManager");

            m_semaphore    = new Semaphore(1, 1);
            m_szAppDir     = appDir;
            m_detector     = new NetworkDetector();
            m_profile      = null;
            m_currWorkMode = WorkMode.Direct;

            // link NetworkDetector to AppManager
            m_detector.NetworkChanged +=
                new NetworkDetector.NotifyAppManagerNetworkChanged(
                    this.DetectorNotify_NetworkChanged);

            // link OS to NetworkDetector
            NetworkChange.NetworkAddressChanged +=
                new NetworkAddressChangedEventHandler(
                    m_detector.OsNotify_NetworkChanged);

            Logger.V("<< AppManager.AppManager");
        }
Exemplo n.º 3
0
        public AppManager(string appDir)
        {
            Logger.V(">> AppManager.AppManager");

            m_semaphore = new Semaphore(1, 1);
            m_szAppDir = appDir;
            m_detector = new NetworkDetector();
            m_profile = null;
            m_currWorkMode = WorkMode.Direct;

            // link NetworkDetector to AppManager
            m_detector.NetworkChanged +=
                new NetworkDetector.NotifyAppManagerNetworkChanged(
                    this.DetectorNotify_NetworkChanged);

            // link OS to NetworkDetector
            NetworkChange.NetworkAddressChanged +=
                new NetworkAddressChangedEventHandler(
                    m_detector.OsNotify_NetworkChanged);

            Logger.V("<< AppManager.AppManager");
        }