Ejemplo n.º 1
0
        public AmbiBeam()
        {
            _config = Properties.Settings.Default["Setting"] as Config;
            if (_config == null)
                _config = new Config();
            
            var trayMenu = new ContextMenu();
            trayMenu.MenuItems.Add("Start/Stop", OnStartStop);
            trayMenu.MenuItems.Add("Configure", OnConfigure);
            trayMenu.MenuItems.Add("Test", OnTest);
            trayMenu.MenuItems.Add("Exit", OnExit);

            _trayIcon = new NotifyIcon
            {
                Text = "AmbiBeam",
                Icon = Properties.Resources.Color,
                ContextMenu = trayMenu,
                Visible = true
            };

            _timer = new System.Timers.Timer
            {
                AutoReset = true,
                Interval = 50
            };

            _mDnsBrowser = new ServiceBrowser();
            _mDnsBrowser.StartBrowse("_ambibeam._udp");
            

        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            string serviceType = "_workstation._tcp";
            if (args.Length >= 1)
            {
                serviceType = args[0];
            }

            ServiceBrowser serviceBrowser = new ServiceBrowser();
            serviceBrowser.ServiceAdded += onServiceAdded;
            serviceBrowser.StartBrowse(serviceType);
            Thread.Sleep(1000);
        }