示例#1
0
        static void Main(string[] args)
        {
            var projectorServerForm = new ProjectorServerForm();
            var projectorServer     = new ProjectorServer(projectorServerForm);
            var serviceHost         = new ServiceHost(projectorServer);

            // discovery
            serviceHost.Description.Behaviors.Add(new ServiceDiscoveryBehavior());
            serviceHost.AddServiceEndpoint(new UdpDiscoveryEndpoint());

            serviceHost.Open();
            Application.Run(projectorServerForm);
        }
        static void Main(string[] args)
        {
            var projectorServerForm = new ProjectorServerForm();
            var projectorServer = new ProjectorServer(projectorServerForm);
            var serviceHost = new ServiceHost(projectorServer);

            // discovery
            serviceHost.Description.Behaviors.Add(new ServiceDiscoveryBehavior());
            serviceHost.AddServiceEndpoint(new UdpDiscoveryEndpoint());

            serviceHost.Open();
            Application.Run(projectorServerForm);
        }