T
Tim Smith
Hi,
If I have 5-10 methods with different signatures, different content
except for the first 6 and last lines, can I use delegates to share
the 12 lines of code.
e.g.
public void method1(string p1, int p2) {
line1();
... line6();
// lines specific to method1 here
line7();
... line6();
}
public int method2(object o, myclass mc, anotherclass ac) {
line1();
... line6();
// lines specific to method2 here
line7();
... line6();
}
etc
I would like to share without making method1,method2, et al
unreadable...
thanks
Tim
If I have 5-10 methods with different signatures, different content
except for the first 6 and last lines, can I use delegates to share
the 12 lines of code.
e.g.
public void method1(string p1, int p2) {
line1();
... line6();
// lines specific to method1 here
line7();
... line6();
}
public int method2(object o, myclass mc, anotherclass ac) {
line1();
... line6();
// lines specific to method2 here
line7();
... line6();
}
etc
I would like to share without making method1,method2, et al
unreadable...
thanks
Tim