Пример #1
0
        private void LoadIpAddressCb(RecordUpdateRequest theRur)
        {
            string strJsonIp = string.Format("Dynamic/Public (JSONIP.com) / {0}", DnsCymbalUpdater.GetPublicIP());

            NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
            foreach (NetworkInterface nic in nics)
            {
                if (nic.NetworkInterfaceType == NetworkInterfaceType.Loopback)
                {
                    // Skip
                }
                else if (nic.OperationalStatus == OperationalStatus.Up && nic.Speed > 0)
                {
                    _cbIpAddress.Items.Add(new IpAddressOption(nic));
                }
            }

            // Add JSONIP dynamic option
            _cbIpAddress.Items.Add(strJsonIp);

            // JSONIP.com option selected?
            if (null != theRur && theRur.IpAddressType == RecordUpdateRequest.IpAddressTypes.JsonIp)
            {
                _cbIpAddress.SelectedItem = strJsonIp;
                _toolTip.SetToolTip(_cbIpAddress, strJsonIp);
            }
        }
Пример #2
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            // Local Variables
            bool bIsService = IsService();

            // Are we a genuine service?
            if (bIsService)
            {
                // Run the service
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                {
                    new MainService()
                };
                ServiceBase.Run(ServicesToRun);
            }
            else
            {
                // Turn on visual styling
                Application.EnableVisualStyles();

                // Run in interactive mode...
                DnsCymbalUpdater dcu = new DnsCymbalUpdater();
                dcu.Start();

                TrayIcon ti = new TrayIcon(dcu);
                ti.ShowDialog();
            }
        }
Пример #3
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            // Local Variables
            bool bIsService = IsService();

            // Are we a genuine service?
            if (bIsService)
            {
                // Run the service
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                {
                    new MainService()
                };
                ServiceBase.Run(ServicesToRun);
            }
            else
            {
                // Turn on visual styling
                Application.EnableVisualStyles();

                // Run in interactive mode...
                DnsCymbalUpdater dcu = new DnsCymbalUpdater();
                dcu.Start();

                TrayIcon ti = new TrayIcon(dcu);
                ti.ShowDialog();
            }
        }
Пример #4
0
 public TrayIcon(DnsCymbalUpdater dcu)
 {
     _dcu = dcu;
     Init();
 }
Пример #5
0
 public TrayIcon(DnsCymbalUpdater dcu)
 {
     _dcu = dcu;
     Init();
 }