コード例 #1
0
        public void InsertMessage(Mensagem mensagem, bool IsMyMessage)
        {
            var grid = (Grid)CurrentScrollViewer.GetChild(0);

            grid.RowsProportions.Add(new Proportion(ProportionType.Auto));
            grid.Widgets.Add(createMessage(mensagem, grid.Widgets.Count, IsMyMessage));
            CurrentTextBox.Text = "";
        }
コード例 #2
0
ファイル: TelaPrincipal.cs プロジェクト: messyoxd/ChatTupla
 public void InsertMessage(string group, string sender, string message, string timestamp, bool isWhisper, string receiver)
 {
     // checar se a mensagem ja nao foi adicionada
     if (this.AdicionaMensagem(group, sender, message, timestamp, isWhisper, receiver))
     {
         // se conseguiu adicionar
         var grid       = (Grid)CurrentScrollViewer.GetChild(0);
         var messageBox = createMessage(
             message,
             sender,
             isWhisper,
             receiver,
             grid.Widgets.Count,
             sender == MyName
             );
         if (messageBox != null)
         {
             grid.RowsProportions.Add(new Proportion(ProportionType.Auto));
             grid.Widgets.Add(messageBox);
             CurrentTextBox.Text = "";
         }
     }
 }