Mercurial > pub > bltoolkit
comparison Tools/DocGen/Content/Doc/ComponentModel/ObjectBinder.htm @ 0:f990fcb411a9
Копия текущей версии из github
| author | cin |
|---|---|
| date | Thu, 27 Mar 2014 21:46:09 +0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:f990fcb411a9 |
|---|---|
| 1 <p class="j"> | |
| 2 The <b>ObjectBinder</b> component has been designed to simplify binding controls on a form to objects for FW 1.x. | |
| 3 Since Microsoft has released FW 2.0 we can use the <b>BindingSource</b> component to bind controls to objects. | |
| 4 However the <b>ObjectBinder</b> still can be useful as it supports a few features which are not available for the <b>BindingSource</b>. | |
| 5 Those features are: | |
| 6 </p> | |
| 7 | |
| 8 <ul> | |
| 9 <li><p class="j">Support for field binding along with property binding.</p></li> | |
| 10 <li><p class="j">Support for inner class field and property binding such as <i>Order.Address.Line1</i>.</p></li> | |
| 11 <li><p class="j">Support for the <i>ObjectView</i> feature which is available by assigning an object view type to the | |
| 12 <b>ObjectBinder.ObjectViewType</b> property. An object view is an object that implements the <b>IObjectView</b> interface. | |
| 13 This interface includes only one property - <i>object <b>Object</b> { get; set; }</i>. | |
| 14 An object view can implement additional properties based on the assosiated object. | |
| 15 The <b>ObjectBinder</b> will combine all of these properties with main object properties and create a single <b>PropertyDescriptor</b> collection. | |
| 16 This feature can be used to separate UI presentation logic from business model objects and to keep them clean. | |
| 17 ObjectView should be a stateless, lightweight object as its single instance can be assigned to many assosiated objects.</p></li> | |
| 18 <li><p class="j">The <b>ObjectBinder</b> is optimized for high performance applications such real-time multithreaded message processing and | |
| 19 distribution banking systems. So it does not use reflection to access objects. | |
| 20 The standard way (which is used by the <b>BindingSource</b>) is to call the <b>TypeDescriptor.GetProperties</b> method | |
| 21 to get a <b>PropertyDescriptor</b> collection. This method creates property descriptors that access object properties by reflection. | |
| 22 The <b>ObjectBinder</b> has its own mechanism to avoid unnessasy reflection and boxing/unboxing operations.</p></li> | |
| 23 </ul> | |
| 24 | |
| 25 <p class="j">The dev version of BLToolkit contains a demo project (Demo\WinForms) showing the use of the <b>ObjectBinder</b>.</p> |
