Exemplo n.º 1
0
        public DGPMessenger()
        {
            byteBufferSize	= 1024;
            byteBuffer		= new byte[byteBufferSize];
            messageBuffer	= "";

            user = new User();

            loggingIn = false;
            _connected = false;
        }
Exemplo n.º 2
0
        public MessageForm(User user, DGPContact contact, Socket socket)
        {
            initData();

            this.user			= user;
            this._contact		= contact;
            this._clientSocket	= socket;
            this.SetDGPContactName( _contact.Name);

            //this.DisplayMessage("Till : " + contact.Name + "\n", Color.Purple, "");
        }
Exemplo n.º 3
0
        /// <summary>
        /// Set variables that are set for all constructors
        /// </summary>
        private void initData()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);

            this._active		= false;
            this._clientSocket	= null;
            this.user			= new User();
        }
Exemplo n.º 4
0
        private MessageForm NewMessageForm(User user, string contactId, Socket socket, bool activate)
        {
            DGPContact contact = new DGPContact(contactId, contactId, OnlineStatus.OFFLINE);
            foreach(DGPContact fr in listBox1.Items)
            {
                if(fr.Id == contactId)
                {
                    contact = fr;
                }
            }

            MessageForm messageForm = new MessageForm(user, contact, socket);

            NewMessageFormCreated(messageForm);

            messageForm.Active		= activate;

            if(activate)
            {
                messageForm.BringToFront();
            }
            return messageForm;
        }