A friend who sees this headline may not understand what's going on, but it doesn't matter. Interested friends can first understand what ivssinglefilegenerator is used to do in the "Implementation of the custom Vssinglefilegenerator"; in Vs.net. Provides a ivssinglefilegenerator interface to easily generate ancillary files for project files, as mentioned in the previous article to automatically generate an attached C # code file based on an XML file; Of course, this ivssinglefilegenerator is not just for XML files, it can be random for any project files to generate satellite files you can just set the relevant custom tools in the file properties.
Why here I proposed in the code file on the basis of the regeneration of the relevant code-related files, why not directly in the original code file to write complete it; The reason is simple because the handwriting code is not faster than the computer, the most important reason is based on XML Ivssinglefilegenerator is not good in some way. This is based on code files as a code description template. Describe the problem encountered in the current situation with XML, In my data persistence layer, XML is used to combine ivssinglefilegenerator to generate related entity classes.
The content might be as follows:
<smarkdatamodels xmlns= "Http://SmarkData.cn/model.xsd" >
<class name= "Customer" table= "Vp_customer" >
<id name= "CustomerID" type= "System.Int64"/>
<property name= "UserName" type= "System.String" comment= "username"/>
<property name= "userpwd" type= "System.String" comment= "User password"/>
<property name= "CustomerType" type= "System.Int32" comment= "Customer Type"/>
<property name= "CustomerName" type= "System.String" comment= "Custom Name"/>
<property name= "Sex" type= "System.Boolean" comment= "gender"/>
<property name= "Region" type= "System.String" comment= "area"/>
<property name= "City" type= "System.String" comment= "urban"/>
<property name= "Idcard" type= "System.String" comment= "identification number"/>
<property name= "Email" type= "System.String" comment= "e-mail"/>
<property name= "Phone" type= "System.String" comment= "Telephone"/>
</Class>
</SmarkDatamodels>
Vssinglefilegenerator generates the following related entities based on XML:
<summary>
User name
</summary>
Public virtual string UserName {
get {
return this.musername;
}
set {
This.musername = value;
This. Entitystate.fieldchange ("UserName");
}
}
<summary>
User password
</summary>
Public virtual string Userpwd {
get {
return this.muserpwd;
}
set {
This.muserpwd = value;
This. Entitystate.fieldchange ("Userpwd");
}
}
<summary>
Customer Type
</summary>
public virtual int CustomerType {
get {
return this.mcustomertype;
}
set {
This.mcustomertype = value;
This. Entitystate.fieldchange ("CustomerType");
}
}