Definition: In the CSK architecture, four standard models are defined by the system, respectively, including addition, editing, listing, and projects, respectively. Increasing the work completed by the model component is that when you need to add a function used in the article system, a link system, etc., other model components are similar to this definition, and can be pushed according to this class.
We are based on the CSK system architecture manual to increase the model component as the entry point to study the specific structure of CSK. A background problem assumption, we need a similar working list, like a list of work, work editing, increased work, and work in the specified skin.
The CSK system uses a typical page code separation mode, which is Microsoft's code post mode, more simply, its page section and the code portion are completely separated. That is to say, all control definitions and functions used in the work list page are completed in its inaudial code. The purpose of this can make the page art workers and the background code staff to complete a job, increase productivity.
To completely work, add some model components, you need to do the following:
1, the background part
a. Complete component or tool class, its directory in Engine / Modules / XXXXX / Components /, here you have to define a physical class you have studied, such as JobModule here, you must define a Jobinfo class, which contains All job information of the database, write it to the class, as the properties of this component, can refer to the other MODULE to complete this entity class. Here, there is also a tool class to write some common functions here, and improve the multiplex efficiency of the code. For example, like Job add, Job edit, get functions such as the specific attributes of JOB, so as to use to use to other components in the model. B. Complete the background code of the relevant page, its directory in Engine / Modules / XXXXX / Content /. We may have a lot of front platforms, in CSK, the so-called front page is all generic skin files, and each skin file needs to have a background code to support. For example, Job's main display page, Job add page, Job edit page, etc., the background code of these pages should be done in this directory, the corresponding file name is similar to addjob.cs, editjob.cs. They are all basic classes of CSK, one is that addjob is inherited from the ContentAddPage class, and the EditJob class is inherited from the ContenTeditPage class, which are in Engine / Framework / BassClasses /. As for why the inheritance from the basic class, can you ask for an angle? What is the benefit of inheriting from the basic class? This is a very worthy of our research. In theory, we can completely a background code. However, after a long-term practice found, many code is in "repeating yesterday's story", like a recorded function page to the database, written in writing, is defining a pile of buttons and TextBox (add, cancel, " Preview, title, You need to add some of the records that are often used. When we want to define a specific function to add a page, you can inherit from the ContentAddPage class directly, just define a specific control in a specific class. As a result, it is not difficult to see that Microsoft's engineer thinks about how thoughtful developers (absolutely no mean for Microsoft advertising :-) c. So there is a engine / modules / xxxxxx / controls directory what is Download, Assending, you can think about some of your own defined control classes. For example, we can redefine a TextBox, expand into a JobBodytext class to complete some specific tasks, which is also in line with the background code for the skin. Object-oriented "open-close price". Specific content can refer to the source code research of CSK. 2, the front section of the front desk is relatively simple, as long as there is a little person who makes the bottom of the page can understand. It is nothing more than that of some controls, the definition of the CSS style sheet, etc., as long as you refer to the source code of CSK, it is easy to master the method.