예제 #1
0
 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);
        }