//
using System;
+using System.Data;
using System.Reflection;
using System.Collections;
using System.ComponentModel;
finalType = null;
}
}
- }
+
+ DataTable table = data_source as DataTable;
+ if (table == null && data_source is DataView)
+ table = ((DataView) data_source).Table;
+
+ if (table != null) {
+ table.Columns.CollectionChanged += new CollectionChangeEventHandler (MetaDataChangedHandler);
+ table.ChildRelations.CollectionChanged += new CollectionChangeEventHandler (MetaDataChangedHandler);
+ table.ParentRelations.CollectionChanged += new CollectionChangeEventHandler (MetaDataChangedHandler);
+ table.Constraints.CollectionChanged += new CollectionChangeEventHandler (MetaDataChangedHandler);
+ }
+ }
public IList List {
get { return list; }
editable.EndEdit ();
}
+ public void Refresh ()
+ {
+ PullData ();
+ }
+
+ [MonoTODO ("This is just a guess, as I can't figure out how to test this method")]
+ protected void CheckEmpty ()
+ {
+ if (list == null || list.Count < 1)
+ throw new Exception ("List is empty.");
+
+ }
+
protected internal override void OnCurrentChanged (EventArgs e)
{
PullData ();
return TypeDescriptor.GetProperties (t, att);
}
+ private void MetaDataChangedHandler (object sender, CollectionChangeEventArgs e)
+ {
+ if (MetaDataChanged != null)
+ MetaDataChanged (this, EventArgs.Empty);
+ }
+
public event ItemChangedEventHandler ItemChanged;
+ public event EventHandler MetaDataChanged;
}
}