Set feature accessors

Source: Internet
Author: User

Program set feature accessors are generally used in a form.

Partial class formabout: FORM {public formabout () {initializecomponent (); this. TEXT = string. format ("about {0}", assemblytitle); this. labelproductname. TEXT = assemblyproduct; this. labelversion. TEXT = string. format ("version {0}", assemblyversion); this. labelcopyright. TEXT = assemblycopyright; this. labelcompanyname. TEXT = assemblycompany; this. textboxdescription. TEXT = assemblydescription;} # region Assembly features Accessors Public String assemblytitle {get {object [] attributes = assembly. getexecutingassembly (). getcustomattributes (typeof (assemblytitleattribute), false); If (attributes. length> 0) {assemblytitleattribute titleattribute = (assemblytitleattribute) attributes [0]; If (titleattribute. title! = "") {Return titleattribute. title ;}} return system. io. path. getfilenamewithoutextension (assembly. getexecutingassembly (). codebase) ;}} Public String assemblyversion {get {return assembly. getexecutingassembly (). getname (). version. tostring () ;}} Public String assemblydescription {get {object [] attributes = assembly. getexecutingassembly (). getcustomattributes (typeof (assemblydescriptionattribute), false); If (attributes. length = 0) {return "";} return (assemblydescriptionattribute) attributes [0]). description ;}} Public String assemblyproduct {get {object [] attributes = assembly. getexecutingassembly (). getcustomattributes (typeof (assemblyproductattribute), false); If (attributes. length = 0) {return "";} return (assemblyproductattribute) attributes [0]). product ;}} Public String assemblycopyright {get {object [] attributes = assembly. getexecutingassembly (). getcustomattributes (typeof (assemblycopyrightattribute), false); If (attributes. length = 0) {return "";} return (assemblycopyrightattribute) attributes [0]). copyright ;}} Public String assemblycompany {get {object [] attributes = assembly. getexecutingassembly (). getcustomattributes (typeof (assemblycompanyattribute), false); If (attributes. length = 0) {return "";} return (assemblycompanyattribute) attributes [0]). company ;}# endregion private void okbutton_click (Object sender, eventargs e) {This. close ();}}

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.