Esempio n. 1
0
        // Test if it is actually the later of 2 entries that is retrieved.
        public void GetNewestEntryTest()
        {
            User     user = new User("Kewin");
            Document doc1 = new Document("text", "Kewins dokument", user);

            doc1.Log.AddEntry(new Document.DocumentLog.Entry(user, "First entry", null));
            Document.DocumentLog.Entry entry1 = new Document.DocumentLog.Entry(user, "Second entry", null);
            doc1.Log.AddEntry(entry1);

            Document.DocumentLog.Entry entry2 = doc1.Log.GetNewestEntry();

            Assert.AreEqual(entry1, entry2);
        }
Esempio n. 2
0
 /**
  * Show the selected log entry in the textBox
  */
 private void listBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     Document.DocumentLog.Entry entry = currentDocument.Log.entries[listBox.SelectedIndex];
     textBox.Text = Regex.Replace(entry.ToStringWithLog(), "\n", Environment.NewLine);
 }