[f-spot] change OrientationChangedHandler to EventHandler



commit f10ab26f1a87f87fb6f3288f2068bad46e203e31
Author: Stephane Delcroix <stephane delcroix org>
Date:   Wed Jun 17 11:03:50 2009 +0200

    change OrientationChangedHandler to EventHandler
    
    no need to define yet another type...

 src/Accelerometer.cs  |    9 ++++-----
 src/PhotoImageView.cs |    2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/Accelerometer.cs b/src/Accelerometer.cs
index 1ba1320..7c7ce1d 100644
--- a/src/Accelerometer.cs
+++ b/src/Accelerometer.cs
@@ -7,12 +7,10 @@ using System.IO;
 
 namespace FSpot {
 
-	public delegate void OrientationChangedHandler (object sender);
-
 	public class Accelerometer {
 		public const string SYSFS_FILE = "/sys/devices/platform/hdaps/position";
 
-		public static event OrientationChangedHandler OrientationChanged;
+		public static event EventHandler OrientationChanged;
 
 		public enum Orient {
 			Normal,
@@ -73,8 +71,9 @@ namespace FSpot {
 			if (new_orient != current_orientation) {
 				current_orientation = new_orient;
 
-				if (OrientationChanged != null)
-					OrientationChanged (null);
+				EventHandler eh = OrientationChanged;
+				if (eh != null)
+					eh (null, EventArgs.Empty);
 
 				Console.WriteLine ("Laptop orientation changed...");
 			}
diff --git a/src/PhotoImageView.cs b/src/PhotoImageView.cs
index 548a61a..286539f 100644
--- a/src/PhotoImageView.cs
+++ b/src/PhotoImageView.cs
@@ -68,7 +68,7 @@ namespace FSpot.Widgets {
 			return this.Pixbuf;
 		}
 
-		public void HandleOrientationChanged (object sender)
+		public void HandleOrientationChanged (object sender, EventArgs e)
 		{
 			Reload ();
 		}



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