Beispiel #1
0
        private void InitializeVariable()
        {
            _constants             = new Constants();
            imageSourceBackgrounds = new BitmapImage();
            imageSource_topBar     = new BitmapImage();

            videos          = new MediaElement[20];
            images          = new Image[20];
            videoPosition   = new Label[20];
            videoTitleLable = new Label[20];
            waitingTB       = new TextBlock[20];
            periodTB        = new TextBlock[20];
            videoStates     = new int[20];
            videoTitle      = new int[20];

            udpComm = null;
            tcpComm = null;

            totalBackgroundImage = 5;
            num                     = 0;
            titleNum                = 0;
            totalTitleNum           = 2;
            currPosD                = 0;
            clientNum               = 100;
            imgNum                  = 0;
            playingId               = -1;
            _totalVideoTime_mars    = 408747;
            _totalVideoTime_student = 314048;

            isColorTest         = false;
            isVideoOnOffVersion = true;

            isFirst          = true;
            isDragging       = false;
            isReverseTime    = false;
            isPlayBtnClicked = false;

            fileName      = "";
            _marsTitle    = "우주 생활";
            _studentTitle = "중학생의 일상";

            _marsFilePath    = "Mars.mp4";
            _studentFilePath = "Student.mp4";
            _playAllMessage  = "PlayAll";
            _pauseAllMessage = "PauseAll";
            serverIP         = "192.168.1.10";

            getDoublePositionDelimiter = ':';
            ipDelimiter = '.';
            messageHandlingDelimiter = '_';
        }
Beispiel #2
0
        private void InstanciaWatchComm()
        {
            string key = "";

            if (System.IO.File.Exists(this.CaminhoEXE() + "\\key.txt"))
            {
                System.IO.StreamReader streamReader = System.IO.File.OpenText(this.CaminhoEXE() + "\\key.txt");
                key = streamReader.ReadLine();

                streamReader.Close();
            }

            TCPComm tcpComm = new TCPComm(this.txtIPRelogio.Text, 9922, txtSenhaComunicacao.Text);

            this._watchComm = new org.cesar.dmplight.watchComm.impl.WatchComm(WatchProtocolType.FaceHanvonF810,
                                                                              tcpComm,
                                                                              1,
                                                                              key,
                                                                              WatchConnectionType.DisconnectedMode,
                                                                              "01.00.0000");
        }
Beispiel #3
0
        private static void Main(string[] args)
        {
            // Get server info
            // Manual connection with argument OR automatic configuration
            var serverEndPoint = args.Length > 0 ?
                                 new IPEndPoint(IPAddress.Parse(args[0]), NetworkNode.portTCP) :
                                 new Server().ConfigServer();

            // Config communication
            var chat = new TCPComm(serverEndPoint.Address);

            chat.Start();

            // Event to receive messages
            chat.ReceivedPackage += ReceivedPackage;
            // Input to send messages
            while (true)
            {
                var msg = Console.ReadLine();
                chat.SendPackage(new CommandPackage(ServerCommands.MESSAGE, Encoding.ASCII.GetBytes(msg), null));
            }
        }
Beispiel #4
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            tcpComm = new TCPComm();
            //tcpComm.Start();
            // socket start
            tcpThread = new Thread(tcpComm.InitSocket);
            tcpThread.IsBackground = true;
            tcpThread.Start();
            tcpComm.OnReceived += TcpComm_OnReceived;

            LoadDefaultImage();
            addTitle(StringEnum.GetStringValue(WindowVideoTitle.Mars), 0, 4);
            for (int row = 0; row < _constants.maxClient / 5; row++)
            {
                for (int col = 0; col < 5; col++)
                {
                    addDefaultView(col, row);
                    addVideoPosition(col, row);
                }
            }
            loadVideo();
        }