banshee r4765 - trunk/banshee/src/Core/Banshee.Services/Banshee.Sources



Author: abock
Date: Tue Oct 28 01:25:38 2008
New Revision: 4765
URL: http://svn.gnome.org/viewvc/banshee?rev=4765&view=rev

Log:
Added typed FindSources generic method

Modified:
   trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs	Tue Oct 28 01:25:38 2008
@@ -349,6 +349,16 @@
             
             source.Activate();
         }
+
+        public IEnumerable<T> FindSources<T> () where T : Source
+        {
+            foreach (Source source in Sources) {
+                T t_source = source as T;
+                if (t_source != null) {
+                    yield return t_source;
+                }
+            }
+        }
      
         public ICollection<Source> Sources {
             get { return sources; }



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