Example #1
0
 private void addTextToBucket(Person otherPerson, Text thisMsg)
 {
     if (PeopleToTexts.ContainsKey(otherPerson))
     {
         LinkedList<Text> textBucket = (LinkedList<Text>)PeopleToTexts[otherPerson];
         textBucket.AddFirst(thisMsg);
         PeopleToTexts[otherPerson] = textBucket;
     }
     else
     {
         LinkedList<Text> textBucket = new LinkedList<Text>();
         textBucket.AddFirst(thisMsg);
         PeopleToTexts.Add(otherPerson, textBucket);
     }
 }
Example #2
0
        private Text setTextValues(XmlElement msg, Person myself, Person otherPerson)
        {
            Text thisMsg = new Text();

            String timestamp = msg.GetAttribute("t");
            int direction = int.Parse(msg.GetAttribute("d"));

            thisMsg.from = direction == 0 ? myself : otherPerson;
            thisMsg.to = direction == 0 ? otherPerson : myself;
            thisMsg.timestamp = timestamp;
            thisMsg.msg = msg.InnerText;

            return thisMsg;
        }