Mgen SPA project 1.5 released

Source: Internet
Author: User

For software updates and descriptions, refer:

Mgen spa Engineering updates and introduction

 

This is the last update of the 1.x version of the SPA project. SPA project 2.0 is under development and is removed from backward compatibility with the 1.x version because it adopts a more flexible update mode.

 

This is an update for the SPA project 1.5:

Add
> Supports multiple rows and input tabs in the stringtextbox feature.
> The stringtextbox feature adds the whitespace option that is not considered for verification.
> Stringtextbox supports target attribute values of the string [] type.
> Added the locenum feature and other related types to make the local enumeration definition more flexible and powerful, and can be marked on the enumeration or attribute.

Improvement
> If the owner is not set, spaformwindow. showdialog automatically sets the application.ProgramMain form.
> Spaformwindow does not use the toolwindow style, because the toolwindows style will be blocked by the taskbar at the bottom of the window maximized under Windows 8.
> Fixed the definition of internal markup extension.

Fix bugs
> After the form is loaded, no exception message is displayed for the control initialization error.
> Fixed some english display errors.

 

 

The current version of the program andSource codeDownload

Note: This is an archive of Microsoft SkyDrive. Please download it directly in your browser. Some download tools may not be available for download.
Sample program running environment:. NET Framework 3.0
SourceCodeEnvironment: Microsoft Visual C #2010 Express

 

 

Some additional notes:

The stringtextbox feature adds many new elements. On the constructor, two parameters (both of which are false by default): Required indicates whether input is required, and pretrimmed indicates whether to call the trim method of the string before verification. At the same time, the ismultiline and acceptstab attributes can specify whether multiple rows are allowed and whether tab input is received in the textbox.

 

At the same time, the stringtextbox feature is also the parent class of two other features, that is to say, its attributes are fully applied to these two types, of course, this is not limited to version 1.5:

 

Stringtextbox from SPA project 1. the basic features in X are inherited from spauiattributebase and derived from stringtextboxrequiredattribute and stringtextboxdigitattribute. The former is the stringtextbox feature of a constructor whose required parameter is true. The latter is similar to the integertextbox feature, however, the application type is string rather than numeric. In the final version 1.5, the stringtextbox feature supports the string [] type. Each row in the textbox corresponds to a string value.

 

Another improvement in 1.5 is the improvement of Enumeration type ing. In the introduction in 1.2, we can see that Enumeration type ing mainly relies on the spaenum and spaenumentry features, set the resource type and resource key value respectively. However, this mode is very fatal. First, some enumeration types (such as. Net predefined) cannot be modified, so no additional features can be defined. Second, even if you can define custom features, it is too cumbersome to use the spaenumentry feature to define a key for each Enumeration type value. Therefore, in 1.5, the enumeration type ing adopts a brand new type locenum feature.

 

First, solve the problem mentioned above. 1. locenum can be defined on an enumeration type or directly marked on the Type attribute that requires spa. In this way, when the SPA project resolves an enumeration type attribute, it will first try to find the locenum feature on the enumeration type. If not, it will look for it directly on the current property. The 1.5 locenum feature is equivalent to the spaenum feature in 1.2, but it also adds many other features, which are defined as follows:

You can not only define the enumerated resource type (restype attribute), but also set the processing result (reserrormode attribute) when the resource is not found ). There is also a mode attribute, which corresponds to the locenumnaming Enumeration type. The default value is autoresource, in this case, the SPA project will directly follow "<Enumeration type name >_< enumeration Value Name> to find resources" (note that there is an underline in the middle), so that users do not need to be like 1.2, manually set the resource keys for all enumerated values to solve problem 2 described above.

 

Of course, the locenumnaming enumeration has another value: customhandler, which has more flexible functions. After setting the mode of the locenum feature to customhandler, you must set the nameresolver attribute of the locenum feature, this attribute type is a type, which must be the ienumnameresolver interface type. This interface has only one method definition:

Public Interface Ienumnameresolver

{

StringResolve (StringName,CultureinfoCulture );

}

 

The name parameter is the input enumerated value string name, And the cultureinfo parameter is the current system. You need to return the display name of the corresponding enumerated value. This can be used in some special enumeration types, especially those that are particularly long and have regular enumeration values.

 

there are many features in SPA project 1. X that I did not come and are written in detail. For example, spavalidationbahavior can define the verification process, and spavalidationtrigger is similar to updatesourcetrigger in WPF. Spaonloadvalidation can define the verification settings when a form is loaded. Spaviewcontroller can manually verify or update the entire form. You can use spauiattributebase to customize a spa UI feature. You can set the spa UI feature or display different UI controls based on different types. Customize the painthandler type to display the spa form in the custom control. One type of SPA information is stored in spatypedata ............ And so on, but version 1.x is over. In the upcoming version 2.0, everything will continue and the SPA project will be more flexible, of course, I also try to spend more time writing more articles for the SPA project after 2.0.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.