[tasque/transition: 101/213] Make TaskNote.Text concrete
- From: Antonius Riha <antoniusri src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tasque/transition: 101/213] Make TaskNote.Text concrete
- Date: Wed, 29 Aug 2012 18:42:31 +0000 (UTC)
commit 3eb41ad5bd12577091dd5b3bbdcbb1f05741196f
Author: Antonius Riha <antoniusriha gmail com>
Date: Thu Aug 16 13:37:03 2012 +0200
Make TaskNote.Text concrete
* Text.Setter: prohibit null values for Text
* OnTextChanged: Add change hook for child classes
src/libtasque/TaskNote.cs | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/src/libtasque/TaskNote.cs b/src/libtasque/TaskNote.cs
index a20b55c..89eb34f 100644
--- a/src/libtasque/TaskNote.cs
+++ b/src/libtasque/TaskNote.cs
@@ -33,6 +33,23 @@ namespace Tasque
{
public abstract class TaskNote
{
- public abstract string Text { get; set; }
+ protected TaskNote (string text)
+ {
+ Text = text;
+ }
+
+ public string Text {
+ get { return text; }
+ set {
+ if (value == null)
+ throw new System.ArgumentNullException ("text");
+ text = value;
+ OnTextChanged ();
+ }
+ }
+
+ protected virtual void OnTextChanged () {}
+
+ string text;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]