B
Buddy Ackerman
I bought the source code for an app and was modifying it however instead of
modifying the code directly I renamed a class and then created a new class
with the old name and inhertied the odl (now renamed ) class. The only
issue the I'm having is the the original class has a method in it the calls
a method of another class and passes itself as a parameter (as "this").
Since it's not longer the same class that it was it won't compile. There
are two methods in this calss that do this and they are also called by other
methods in the class (so I can't just delete them and move them to the new
derived class). Here's and example of the problem
public class MyClassBase_Old
{
public string method1()
{
return OtherClass.Method1(this);
}
public string method2 ()
{
return Method1();
}
}
public class MyClassBase: MyClassBase_Old
{
public NewMethod()
{
return "something";
}
}
The OtherClass.Method1 takes a MyClassBase object. Any ideas on how to fix
this?
--Buddy
modifying the code directly I renamed a class and then created a new class
with the old name and inhertied the odl (now renamed ) class. The only
issue the I'm having is the the original class has a method in it the calls
a method of another class and passes itself as a parameter (as "this").
Since it's not longer the same class that it was it won't compile. There
are two methods in this calss that do this and they are also called by other
methods in the class (so I can't just delete them and move them to the new
derived class). Here's and example of the problem
public class MyClassBase_Old
{
public string method1()
{
return OtherClass.Method1(this);
}
public string method2 ()
{
return Method1();
}
}
public class MyClassBase: MyClassBase_Old
{
public NewMethod()
{
return "something";
}
}
The OtherClass.Method1 takes a MyClassBase object. Any ideas on how to fix
this?
--Buddy