コード例 #1
0
        public ConfigDialog(MainWindow owner)
        {
            InitializeComponent();

            this.Owner = owner;
            WindowStartupLocation = WindowStartupLocation.CenterOwner;
            filePathTextBox.Text = owner.BasePath;
            txtBroadcast.Text = Properties.Settings.Default.broadcastPort.ToString();
            txtWebcam.Text = Properties.Settings.Default.webcamPort.ToString();
            txtClient.Text = Properties.Settings.Default.clientPort.ToString();
            cbxRecord.IsChecked = owner.AllowVideoRecord;
            cbxSound.IsChecked = owner.AllowSoundAlarm;
            
            cbxRecord_Checked(null, null);
        }
コード例 #2
0
        public ConnectionManager(MainWindow mainWindow, int broadcastPort, int camPort, int clientPort, string basePath)
        {
            this.mainWindow = mainWindow;
            this.BasePath = basePath;
            this.BroadcastPort = broadcastPort;
            webcamManager = new WebcamManager();
            clientManager = new ClientManager();
            relations = new Dictionary<Client, Webcam>();

            webcamListener = new TcpListener(IPAddress.Any, camPort);
            webcamListener.Start();

            ThreadStart wcListener = new ThreadStart(ListenForWebcam);
            Thread wcThread = new Thread(wcListener);
            wcThread.Start();

            clientListener = new TcpListener(IPAddress.Any, clientPort);
            clientListener.Start();

            ThreadStart clListener = new ThreadStart(ListenForClient);
            Thread clThread = new Thread(clListener);
            clThread.Start();
        }