Inheritance is relatively simple. For example, there is a class named text100 in designer. CS, which can be directly written in text. CS:
Public class text // This is the base class {private int _ length = 0; public text (INT length) {_ length = length ;}}
Public partial class text100: Text // This is the LINQ class already declared in designer {.... // The constructor cannot be written here, because the designer. written in CS}
The base class constructor cannot be called here, but you can call partial void oncreate () (declared in deisigner. CS) to complete the work that the constructor wants to do. The final result is:
Public class text // This is the base class {private int _ length = 0; // public text (INT length) // It seems to be commented out, otherwise it is always called. I have never tried to keep it. // {// _ Length = length; //} public partial class text100: Text // This is the LINQ class {void oncreate () that has been declared in designer () // complete the work of calling the constructor here. {_ Length = 100 ;}}
This oncreate () has a partial version in the definition of text100, which is the only sentence in the text100 Constructor (which can be found in designer. CS). In other words, it is used to solve the problem of base class constructor.
This automatically generated class also has many on... functions, which can solve other basic class calling problems.
Click to download the free agile development textbook: Martian agile development manual