コード例 #1
0
ファイル: DataMessage.cs プロジェクト: eyalmazuz/ChatRoom
 public DataMessage(FuncMessage msg)
 {
     this.GUID         = msg.guid;
     this.timeStamp    = msg.dateTime;
     this._messageBody = msg.messageBody;
     this._user        = msg.user;
     this.editable     = msg.Editable;
 }
コード例 #2
0
 //Recive a message and changed its text.
 public void editMessage(DataMessage m, String editText)
 {
     try
     {
         DateTime    msgDateTime = DateTime.Now.ToLocalTime();
         FuncMessage newMessage  = new FuncMessage(editText, m.guid, msgDateTime, m.user);
         newMessage.replace();
     }
     catch (Exception e)
     {
         throw e;
     }
 }
コード例 #3
0
 // Sends a message to the server and returns a Message object.
 public FuncMessage sendMessage(String msg)
 {
     try
     {
         FuncMessage sentMsg = FuncMessage.Create(msg, this);
         sentMsg.Send();
         return(sentMsg);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
コード例 #4
0
        //Send message to the Server
        public Boolean SendMessage(String messageBody)
        {
            if (!ExceptionHandler.CheckValidty(messageBody))
            {
                return(false);
            }
            try
            {
                FuncMessage sentMsg = CurrentUser.sendMessage(messageBody);
                RetriveTenlastMessages();
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }



            return(true);
        }