Last week I supervised the first steps to convert a large project from VO to X# which is maintained on site by one of my employees. They often use methods like this:
method ShowControl(lShow) CLASS Control
if lShow
self:Show()
else
self:Hide()
endif
return true
This makes it easy to quickly hide/show all controls in a screen.
In VOPorter this generates CLASS control_external_class INHERIT control which of course is not a solution to the problem.
Is there another way to solve this without creating subclasses for every type of control and changing 1000's of controls in 100's of windows to the inherited classes?
Dick
Best way to convert a method of Class Control
Best way to convert a method of Class Control
Hi Dick,
since this method is only using public methods of the class, you can use an extension method:
HTH
Wolfgang
since this method is only using public methods of the class, you can use an extension method:
Code: Select all
static class ControlExtensions
static method ShowControl( self oControl as control, lShow as logic ) as logic
if lShow
oControl:Show()
else
oControl:Hide()
endif
return true
end class
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Best way to convert a method of Class Control
Thank you Wolfgang!
I've added your solution in my conversion documentation and my employee will apply it.
Dick
I've added your solution in my conversion documentation and my employee will apply it.
Dick