public MainWindow()
        {
            InitializeComponent();

            UpdateStatus("Starting server...");

            BroadcastPort = Properties.Settings.Default.broadcastPort;
            WebcamPort = Properties.Settings.Default.webcamPort;
            ClientPort = Properties.Settings.Default.clientPort;
            BasePath = Properties.Settings.Default.basePath;

            if (string.IsNullOrEmpty(BasePath))
                BasePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);

            wcPresenter = new WebcamPresenter(this);
            clPresenter = new ClientPresenter(this);
            resourcePresenter = new ResourcePresenter(this);

            cbxDevice.Items.Add("All webcams");
            cbxDevice.SelectedIndex = 0;
            UpdateStatus("Ready!");
            /* irrelevant code!!!
            Uri dictUri = new Uri(@"Skins/WhistlerBlue.xaml", UriKind.Relative);
            ResourceDictionary resourceDict = Application.LoadComponent(dictUri) as ResourceDictionary;
            Application.Current.Resources.MergedDictionaries.Clear();
            Application.Current.Resources.MergedDictionaries.Add(resourceDict);*/
        }
示例#2
0
        public Client(TcpClient client, WebcamPresenter presenter)
        {
            tcpClient = client;
            networkStream = tcpClient.GetStream();
            wcPresenter = presenter;
            IP = ((IPEndPoint)client.Client.RemoteEndPoint).Address.ToString();

            ReceiveMessage();
        }