Exemplo n.º 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);
            }
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 4
0
 public TrayIcon(DnsCymbalUpdater dcu)
 {
     _dcu = dcu;
     Init();
 }
Exemplo n.º 5
0
 public TrayIcon(DnsCymbalUpdater dcu)
 {
     _dcu = dcu;
     Init();
 }