Xpo devexpress
Respectively: $(ProjectDir)Tools\PostBuild.bat $(ProjectDir) Now you just need to call these batch files in the Visual Studio build events with $(ProjectDir)Tools\PreBuild.bat $(ProjectDir)
XPO DEVEXPRESS CODE
The 0 at the end of them is important as otherwise code 2 is returned (for whatever reason) and the Visual Studio build system will complain about it every build. %1Tools\fart.exe -r -C "%1*.designer.cs" "\x2f\ = this.unitOfWork " " = this.unitOfWork " %1Tools\fart.exe -r -C "%1*.designer.cs" "(()(this.xpKern)).EndInit() " 0Īnd the post-build one that reverts the changes: %1Tools\fart.exe -r -C "%1*.designer.cs" "\x2f\x2fthis.xpKern = new (ponents) " "this.xpKern = new (ponents) " %1Tools\fart.exe -r -C "%1*.designer.cs" " = this.unitOfWork " "\x2f\ = this.unitOfWork " Here is the content of the pre-build batch file: %1Tools\fart.exe -r -C "%1*.designer.cs" "this.xpKern = new (ponents) " "\x2f\x2fthis.xpKern = new (ponents) " Therefore I simple wrote two batch files (using a command line replacement tool called FART), one that runs before the build starts and makes sure no XPCollection is initialized in the InitializeComponent method (by just commenting the lines of code) and a second one that runs after the build finished and reverts these changes. That would have been very bad, because I do have a lot of big forms in this project and I really don’t like to build them all in code.īut I found another way – I will not call that solution, just a work-around – to be still able to use the designer:
XPO DEVEXPRESS WINDOWS
They suggested to not set the XPCollection at design time, but this would result in losing the possibility to build the forms in the Windows Forms Designer. NET Framework they can’t do anything about it unfortunately. They researched what causes the data request and determined that the XPCollection.Count property is requested by the CurrencyManager after the Control.UpdateBindings method call. Of course, I’ve first contacted the always very fast and helpful DevExpress support. But as I wrote that was not the case for all forms: when loading the other forms only the current data object (the current row in the table) was loaded as expected.
It was basically a SQL query that loads all (and I mean really all) data rows from the database which is obviously not a very good idea. Additionally DevExpress XPO is very useful as database abstraction layer.īut in a current project I came across a very strange issue:įor a few forms (curiously not for all) a very expensive SQL query is sent to the database backend while the form is loading. NET projects I do like to use the controls by DevExpress.