I still would like to find me a way to call the inherit class from the base class.
It may not be possible..., if i just could reach the object from inside the baseclass i would be fine.
I already understand the comparison may not do but this is somewhat what i need:
(Baseclass)
Code:
using System; using System.Collections.Generic; using System.Text; abstract class Class1 { public abstract string GetABC(int colIndex); public string GetXYZ(int colIndex) { return GetABC(colIndex); } }
Code:
using System; using System.Collections.Generic; using System.Text; class Class2 : Class1 { public override string GetABC(int colIndex) { switch (colIndex) { case 1: return "abc"; case 2: return "def"; } return ""; } }
Code:
private void button1_Click(object sender, EventArgs e) { Class2 c = new Class2(); MessageBox.Show( c.GetXYZ(1)); }
Unless you run the init call by testing a variable and place this line in every call.
Call's not being overridden will never initialize.
Conclusion(?):
This means right after create i must call an initialize.
(But that wouldn't be an automated call then)
Leave a comment: