[blam] Item: Create update delegate/event properly



commit 1cea316e69795f35fa952c47a70c8a849318e0c4
Author: Carlos Martín Nieto <carlos cmartin tk>
Date:   Wed Sep 15 04:30:58 2010 +0100

    Item: Create update delegate/event properly

 src/Item.cs |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/Item.cs b/src/Item.cs
index 332e221..d981df4 100644
--- a/src/Item.cs
+++ b/src/Item.cs
@@ -18,7 +18,8 @@ namespace Imendio.Blam {
 
         public SyndicationContent exposed_text;
 
-        public delegate void Updated(Item item);
+        public delegate void UpdateHandler(Item item);
+        public event UpdateHandler Updated;
 
 		public string Keywords {
 			get {
@@ -67,11 +68,12 @@ namespace Imendio.Blam {
 		{
 			if (Unread != unread) {
 				Unread = unread;
-                Updated(this);
+                if(Updated != null){
+                    Updated(this);
+                }
                 /* FIXME: Re-implement this */
 				Application.TheApp.ItemList.Update (this);
-				}
-			}
-		}
-	}
+            }
+        }
+    }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]