예제 #1
0
        public Invitation_Form(int _roomID)
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.Manual;

            this.isMove  = false;
            this._roomID = _roomID;
            _UserCount   = 0;
            _userList    = BlindChat.GetUserList(this._roomID);

            btn_Invite.BackColor    = btn_Cancel.BackColor = BlindColor.DarkGreen;
            lbl_UserCount.BackColor = label1.BackColor = btn_close.BackColor = BlindColor.DarkGreen;
            lbl_UserCount.ForeColor = label1.ForeColor = BlindColor.Light;
            btn_Cancel.ForeColor    = btn_Invite.ForeColor = BlindColor.Light;

            panel5.BackColor = BlindColor.Light;
            panel4.BackColor = BlindColor.Gray;

            InvitationItem_LayoutPanel.BackColor = BlindColor.Gray;

            BlindNetUtil.SetEllipse(this, 5);
            BlindNetUtil.SetEllipse(panel5, 5);

            BlindNetUtil.SetEllipse(btn_Invite, 15);
            BlindNetUtil.SetEllipse(btn_Cancel, 15);
        }
예제 #2
0
        public Control_Room(uint UserID, BlindChat BlindChat)
        {
            InitializeComponent();
            _UserID = UserID;

            lbl_room.ForeColor   = BlindColor.Light;
            btn_Create.BackColor = Color.Transparent;
            panel1.BackColor     = panel3.BackColor = RoomItem_LayoutPanel.BackColor = BlindColor.Gray;
        }
예제 #3
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            VPNClass = new VPN_Class();
            //클라이언트 cid 서버로부터 받아오기
            //ClientID = "test1";
            string SendMsg = ClientID + "," + isInner;                             //아이디 + 내부 외부 보내서 외부면 vpn로그남김 (isInner bool형. 디버그했을때 실질적인 값 : true -> "True" | false -> "False")

            byte[] SendStringToByteGender = Encoding.UTF8.GetBytes(SendMsg);       // String -> bytes 변환
            mainSocket.CryptoSend(SendStringToByteGender, PacketType.Response);    //서버로 클라이언트 id 보냄
            blindClientCidPacket = mainSocket.CryptoReceive();                     // 서버로부터 cid받아옴
            byte[] data = BlindNetUtil.ByteTrimEndNull(blindClientCidPacket.data); // 넑값 지움
            byte[] tmp  = new byte[4];
            Array.Copy(data, 0, tmp, 0, data.Length);
            uint ClintCID = BitConverter.ToUInt32(tmp, 0);

            if (ClintCID == 0) //서버에서 아이디를 조회못했을때 0반환
            {
                MessageBox.Show("서버로부터 id를 받지 못하였거나 등록되지 않은 아이디입니다." + Environment.NewLine + "\t           관리자에게 문의하십시요.");
                mainSocket.Close();
                Application.Exit();
                return;
            }

            //각 기능 객체 및 Task 생성
            TaskScheduler scheduler = TaskScheduler.Default;

            token = new CancellationTokenSource();

            documentCenter = new Doc_Center(document_Center, isInner);
            documentCenter.Run();
            document_Center.docCenter = documentCenter;

            _ChatMain      = new ChatMain(ClintCID);
            _ChatMain.Dock = DockStyle.Fill;
            MainControlPanel.Controls.Add(_ChatMain);

            //Func
            chat  = new BlindChat(ClintCID, ref _ChatMain, this);
            tChat = Task.Factory.StartNew(() => chat.Run(), token.Token, TaskCreationOptions.LongRunning, scheduler);

            //ScreenLocking
            lockForm = new LockForm(isInner, ClientID);
            lockForm.connect();
            MessageBox.Show("락 연결!");

            deviceDriver  = new DeviceDriverHelper();
            tDeviceDriver = Task.Factory.StartNew(() => deviceDriver.Run(), token.Token, TaskCreationOptions.LongRunning, scheduler);
        }
예제 #4
0
        private void btn_Invite_Click(object sender, EventArgs e)
        {
            if (_UserCount < 1)
            {
                MessageBox.Show("1명 이상 선택해 주세요");
            }
            else
            {
                foreach (CreateRoom_Item item in InvitationItem_LayoutPanel.Controls)
                {
                    if (item.isClicked)
                    {
                        BlindChat.InviteUser(item.UserID, _roomID);
                    }
                }

                this.Close();
            }
        }
예제 #5
0
        private void Room_Item_Load(object sender, EventArgs e)
        {
            this.lbl_Name.Text = _Room.Name;

            DateTime currentTime = DateTime.Now;
            DateTime messageTime = Convert.ToDateTime(_Room.LastMessageTime);

            TimeSpan gapTime = currentTime - messageTime;

            if (gapTime.Days < 1)
            {
                this.lbl_Time.Text = messageTime.ToString("tt hh:mm");
            }
            else if (gapTime.Days < 2)
            {
                this.lbl_Time.Text = "어제";
            }
            else
            {
                this.lbl_Time.Text = messageTime.ToString("MM:dd");
            }
            lbl_userCount.Text = BlindChat.GetUserList(_Room.ID).Count().ToString() + "    |";
        }
예제 #6
0
        public Room_Menu(uint userID, ChatRoom room)
        {
            InitializeComponent();

            this.isMove            = false;
            this._room             = room;
            this.UserID            = userID;
            this.lbl_RoomName.Text = room.Name;
            this.StartPosition     = FormStartPosition.Manual;
            _userList = BlindChat.GetUserList(_room.ID);

            btn_Invite.BackColor = btn_close.BackColor = panel1.BackColor = lbl_RoomName.BackColor = BlindColor.DarkGreen;

            lbl_RoomName.ForeColor = BlindColor.Light;
            btn_exit.BackColor     = BlindColor.DarkGreen;
            btn_close.ForeColor    = BlindColor.Light;
            panel2.BackColor       = BlindColor.Light;
            label1.ForeColor       = BlindColor.Secondary;

            BlindNetUtil.SetEllipse(this, 5);
            BlindNetUtil.SetEllipse(panel5, 5);
            BlindNetUtil.SetEllipse(btn_Invite, 20);
        }
예제 #7
0
 public void SetBlindChat(BlindChat chat)
 {
     _BlindChat = chat;
 }
예제 #8
0
 private void btn_exit_Click(object sender, EventArgs e)
 {
     BlindChat.ExitRoom(UserID, _room.ID);
     Close();
 }