/[xmltv_parser]/trunk/libxmltv/Core/XMLTV.cs
ViewVC logotype

Diff of /trunk/libxmltv/Core/XMLTV.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/libxmltv/Core/XMLTV.cs	2013/03/10 19:44:49	125
+++ trunk/libxmltv/Core/XMLTV.cs	2013/03/10 20:19:33	126
@@ -96,39 +96,34 @@
             return list;
         }
 
-        public static BindingSource CreateBindingSourceForData(object data)
+        public static object CreateDataSourceFromObject(object data)
         {
             if (data == null) { throw new ArgumentNullException("data", "cannot be null"); }
-            BindingSource source = new BindingSource();
+            //BindingSource source = new BindingSource();
 
             IDataSourceBindable binder = (data as IDataSourceBindable);
             if (binder == null) { throw new InvalidCastException(string.Format("Cannot cast: '{0}' to '{1}'", data.GetType().Name, typeof(IDataSourceBindable).Name)); }
             object bindable = binder.CreateBindableDataSource();
-            source.DataSource = bindable;
-            return source;
+            //source.DataSource = bindable;
+            //return source;
+            return bindable;
         }
 
-        public static BindingSource CreateFilterFromDataSource(object source, params string[] args)
+        public static void CreateFilterFromDataSource(ref object source, params string[] args)
         {
             if (source == null) { throw new ArgumentNullException("source", "cannot be null"); }
             if (args == null) { throw new ArgumentNullException("args", "cannot be null"); }
             IDataSourceFilterable filter = (source as IDataSourceFilterable);
             if (filter == null) { throw new InvalidCastException(string.Format("Cannot cast: '{0}' to '{1}'", source.GetType().Name, typeof(IDataSourceFilterable).Name)); }
-            object filtered = filter.Filter(source,args);
-            BindingSource bound = new BindingSource();
-            bound.DataSource = filtered;
-            return bound;
+            filter.Filter(ref source,args);            
         }
-        public static BindingSource CreateSorterFromDataSource(object source, params string[] args)
+        public static void CreateSorterFromDataSource(ref object source, params string[] args)
         {
             if (source == null) { throw new ArgumentNullException("source", "cannot be null"); }
             if (args == null) { throw new ArgumentNullException("args", "cannot be null"); }
             IDataSourceSortable sorter = (source as IDataSourceSortable);
             if (sorter == null) { throw new InvalidCastException(string.Format("Cannot cast: '{0}' to '{1}'", source.GetType().Name, typeof(IDataSourceSortable).Name)); }
-            object sorted = sorter.Sort(source, args);
-            BindingSource bound = new BindingSource();
-            bound.DataSource = sorted;
-            return bound;
+            sorter.Sort(ref source, args);            
         }
         #endregion
         #endregion

 

  ViewVC Help
Powered by ViewVC 1.1.22