Fixed a bug where an exception occurred in Corp Exch Rate when it was possible for a divide by zero error to occur during control validation.  Just needed some additional protection in an if statement.  This is where the code checks to see if there is a matching inverse rate for the currency pair on the same date.
Merge from trunk of Christian's major rework of error handling on the server side.  No conflicts.
Only change is that I have added:  grdDetails.CancelEditingWithEscapeKey = false to these templates so that the grid does not capture the ESCAPE key when the grid has the focus.  Otherwise the ESCAPE key cannot close the window when the grid has the focus.
Added a user preference for 1. Esc key closing screen and 2. Save window positions
Added a property 'DroppedDown' so that we can tell if the combo box is dropped down for this user control.  We need this for issue # 2272
These are the main code changes that deal with ESC and window position.  The solution to the issue is to ensure that the Form.KeyPreview property needs to be true.  Then the keyboard handler that is already in the generated code comes to life.  But then we need to check that there is no control on the form that needs the escape key - for example a dropped down combo box.  The partner find screen needed changing because the CancelButton property was set for both modal and modeless display, which is no good.

This checkin also contains all the code to save and restore the window sizes, positions and the distances of any splitter bars the screen contains.  The information is stored in the common settings folder for each login user of OP.
Merge from trunk.  No cconflicts.
Decided it is much better to have the grd.CancelEditingWithEscapeKey = false; being auto-generated rather than being explicit in the templates.  This is because we sometimes have multiple grids or grids that are not called grdDetails so if the focus is on those controls it will still inhibit our Escape key from closing the screen.  So this small change means we auto-generate this code.  Also the checked List Box (clb) is derived from the SourceGrid so we apply this automatically to any CheckedListBox.
These screens are not derived from templates and needed either the grdDetails.CancelEditingWithEscapeKey = false; line adding or they needed to have the this.CancelButton = btnCancel line adding in order to make the screen close with the escape key.
I have removed the line grdDetails.CancelEditingWithEscapeKey = false; from all these templates (which I added in a previous checkin), because it is much better to auto-generate this line for every SourceGrid whatever its name.  There are screens that have two grids and now we will be able to close the screen with escape whichever of these has the focus.

I have also removed the // TODO line from these templates that referred to saving the screen size and position since that is now done (in a different place).
Removed the constants that were defined for saving splitter positions on Partner/Find because this is now done centrally for all screens.
Added the CancelEditingWithEscapeKey = false to these designer files that are associated with screens that are not generated from YAML so that when the grid has the focus it will allow the screen to be closed with ESCAPE.  In the case of the PartnerNewDialog I had put it in manual code in a previous checkin, but now I have moved it to the designer file to be consistent.
Added a new user control derived from PrintPreviewControl so that we can override the ProcessCmdKey method.  This allows us to close the screen with ESCAPE when the control has the focus.  However we probably still need to investigate the circumstances where the control does actually want the ESCAPE key.  I do not know what these are at present because I can't use the control.
Just modified the YAML so that the splitter bar gets the ControlDark colour to make it more obvious - as in other screens that have splitters.
These screens have tabs so they now need a call to RestoreAdditionalWindowProperties in the relevant TabChanged method.  This is because we can only set splitterbar distances once the page that hosts them has been displayed.
Removed code that was to do with saving splitter distances.  It was actually not called but had obviously been experimented with.  Anyway, this branch now has code to save splitter distances all built in to the FPetraUtilsObject, so this is not needed any more.
Needed to make a number of changes to the code I already wrote for saving splitter positions.  It turns out that you can only restore a splitter distance when the screen is activated and indeed the userControl has been shown.  This means that the Partner/Find screen is the biggest challenge.  It has 4 splitters on two tabs.  All splitters are inside user controls rather than being part of the form.  And on top of that one of the user controls that has a splitter is instantiated twice, so the same splitter parent/controlname occurs twice and needs to e separately accounted for!!

So this check in contains all the new code to achieve this and make Partner/Find work correctly in saving and restoring splitter positions.
Uncrustify
Merge from trunk - no conflicts
This is the changes to the Winforms templates regarding doing the reference count.  Now we do a limited initial count and then ask the user if they want to do a full one if the limit was exceeded.  The checkin also includes a new helper class to deal with message boxes that display results.  This keeps some code out of the template and the need to copy and paste the same stuff everywhere.