示例#1
0
        public FileMessageBubble(FileShareMiddleController fsmc, string time, MsgType messageType)
        {
            InitializeComponent();


            fsmiddleController = fsmc;

            setControllerSubscriptions(fsmc);

            this.bubbleTime.Text = time;

            if (messageType.ToString() == "IN")
            {
                //incomming Message
                this.BackColor = inMsgColor;
//                this.bubbleText.ForeColor = inMsgTextColor;
                this.bubbleTime.ForeColor = inMsgTimeColor;
            }
            else
            {
                //outGoing
                this.BackColor = outMsgColor;
//                this.bubbleText.ForeColor = outMsgTextColor;
                this.bubbleTime.ForeColor = outMsgTimeColor;
            }
        }
示例#2
0
        public AudioMessageBubble(FileShareMiddleController fsmc, string time, MsgType messageType)
        {
            InitializeComponent();

            inPath = Path.GetFullPath(settings.Default.audioInPath);

            outPath = Path.GetFullPath(settings.Default.audioPath);

            fsmiddleController = fsmc;

            setControllerSubscriptions(fsmc);

            this.bubbleTime.Text = time;

            type = messageType;
            if (messageType.ToString() == "IN")
            {
                //incomming Message
                this.BackColor = inMsgColor;
//                this.bubbleText.ForeColor = inMsgTextColor;
                this.bubbleTime.ForeColor = inMsgTimeColor;
            }
            else
            {
                //outGoing
                this.BackColor = outMsgColor;
//                this.bubbleText.ForeColor = outMsgTextColor;
                this.bubbleTime.ForeColor = outMsgTimeColor;
            }
        }
示例#3
0
        private void unsetControllerSubscriptions(FileShareMiddleController fileShareMiddleController)
        {
            fileShareMiddleController.Connected -= OnConnected;
            fileShareMiddleController.DisconnectedTransferClient -= OnTransferClientDisconnected;
            fileShareMiddleController.ChangedProgress            -= OnTransferClientProgressChanged;

            fileShareMiddleController.QueuedTransferClient    -= OnTransferClientQueued;
            fileShareMiddleController.CompletedTransferClient -= OnTransferClientCompleted;
            fileShareMiddleController.StopedTransferClient    -= OnTransferClientStopped;
        }
示例#4
0
        public ChatDisplay(string token, FileShareMiddleController fsmc)
        {
            if (!this.DesignMode)
            {
                InitializeComponent();
            }

            controlHandler = ControlHandler.getInstance();
            controlMessage = ControlMessage.getInstance();

            ipTokenInChat      = token;
            userTokenText.Text = token;

            fileShareMiddleController = fsmc;

            controlHandler.FileComming   += OnFileComming;
            controlHandler.FileConfirmed += OnFileConfirmed;
            controlHandler.FileRejected  += OnFileRejected;
            controlHandler.AudioComming  += OnAudioComming;


            fileShareMiddleController.QueuedTransferClient += onQueued;
        }