
subsonicproject - issue #90
Patch for activerecord, activelist, class template, sqlite
This is a patch for several things. Allows ProviderName to be set at ActiveRecord level. Makes more use of ProviderName in ActiveList. Adds INotifyProperyChanged interface to table classes. Improved SqliteDataProvider.
- patch_5_18_09.patch 76.08KB
Comment #1
Posted on May 26, 2009 by Happy RhinoI also implemented the INotifyPropertyChanged interface.
http://code.google.com/p/subsonicproject/issues/detail?id=73
You should be aware that, with your implementation, every write within an external event handler causes a StackOverflow Exception.
Example: You have this method in a vb winform app:
Public Sub Product_Changed(sender as object, e as PropertyChangedEventArgs) handles product.PropertyChanged
Product.Sum = Product.Price * Product.Amount
End Sub
Every time you change a value the Sub Product_Changed is called which causes the Sum to be changed, which raises the PropertyChanged Event, which calls the Product_Changed Sub (you get the point?) -> StackOverFlowException
You also should keep in mind that, if you load a collection with 1000 ActiveRecord Objects with 100 ColumnValues you have 100.000 needles Events.
(I use a bool Product.RaisePropertyChangedEvent Property which defaults to false, to avoid this)
My code would look:
Public Sub Product_Changed(sender as object, e as PropertyChangedEventArgs) handles product.PropertyChanged
Product.RaisePropertyChangedEvent = false Product.Sum = Product.Price * Product.Amount Product.RaisePropertyChangedEvent = true
End Sub
Comment #2
Posted on Jun 16, 2009 by Swift BirdWhat you say looks right I never checked that. Easy enough to fix. I got the binding code from the v3 project and it may need to be fixed there as well.
Status: New
Labels:
Type-Defect
Priority-Medium