Esempio n. 1
0
        public GDISendingChannel(GDIDeviceContext dc)
        {
            fFormatter = new BinaryFormatter();
            fMemoryStream = new MemoryStream(2048);

            fDeviceContext = dc;

            // Create the client
            fGDISpeaker = new UdpClient();

            // Create the broadcast socket
            IPAddress ip = IPAddress.Parse(GDIPortal.Multicast_Pixtour_Group);
            fBroadcastSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
            fBroadcastSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(ip));
            fBroadcastSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, 255);

            IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(GDIPortal.Multicast_Pixtour_Group), GDIPortal.Multicast_Pixtour_Port);
            fBroadcastSocket.Connect(ipep);


            // Setup the speaker
            fGraphPort = new GCDelegate(fDeviceContext.Resolution);
            fGraphPort.CommandPacked += new GCDelegate.DrawCommandProc(CommandPacked);


            // Setup the antennae to listen for commands
            fReceiver = new GDIReceivingChannel(GDIPortal.Multicast_Pixtour_Group, GDIPortal.Multicast_Pixtour_Port, fDeviceContext);
        }
Esempio n. 2
0
 /// <summary>
 /// Creates an instance of the graphical context with
 /// the modes defined in the hashtable 'settings'
 /// </summary>
 /// <param name="settings">
 /// List of modes, which describes the graphical context
 /// </param>
 public GraphicsContext(Hashtable settings)
 {
     graphicalSettings = settings;
     gcNotification    = new GCDelegate(dummy);
     stateOfSettings   = new Hashtable(10, 0.2f);
 }
 /// <summary> 
 /// Creates a graphical context with no initial 
 /// graphical modes 
 /// </summary> 
 public GraphicsContext()
 {
     graphicalSettings = new Hashtable(10, 0.2f);
     gcNotification = new GCDelegate(dummy);
     stateOfSettings = new Hashtable(10, 0.2f);
 }