...
Control Replacement Primer
Upgrading a control has three types
...
of work:
...
1) upgrading the object model and members in logic
...
Good news is that this is the same as upgrading a standard (i.e. non-control) API
...
If a control is being migrated to a component, do not use role=control
2) upgrading event handlers
- event arg types
- event name changes
- event handler arguiments -- these are statements added to the event handler to setup the old style event args as local variables in the handler.
Code Block |
---|
<event id="ItemClick" netName="ItemClick" migStatus="mscomctl" role="event" netHandler="System.Windows.Forms.ListViewItemSelectionChangedEventHandler" netArgs="ListViewItemSelectionChangedEventArgs" migPattern="ItemSelectionChanged" > <argument id="item" type="ListItem" status="ByVal" migPattern="%1d = e.Item" /> </event> |
3) Designer code -- property initialization
- these are specifications for what properties to set in teh designer.cs code file adn how to set them
...
Code Block |
---|
<migClass id="NetControl.fpDoubleSingle" migName="NumericUpDown" parent="fpDoubleSingle"> <property id="BackColor" type="OLE_COLOR" value="IfpDoubleSingle.BackColor" nPram="3" migPattern="System.Drawing.Color.FromArgb(%3d, %2d, %1d)" default="System.Drawing.SystemColors.WindowText" /> |
id = name of .NET property to write in designer.cs file
...
default = the appropriate default for the property
type, nPram, migPattern = literals