Reflection applications in TFs custom development

Source: Internet
Author: User

Recently, CM (Configuration Management) colleagues encountered a problem during custom TFs development.

Leaders require quick development of a tool that can automatically connect to TFS, automatically check out some Word files, and then automatically check in after the program is modified. (Such as signature) This implementation requires three aspects: 1. find the available UI based on the existing TFs interface, and then find the corresponding dll2. use the reflection of C # to obtain the corresponding field or attribute and change it. 3. If the existing UI is not satisfied, implement the interface again based on the tfs api. TFS interface 1 The class name is teamprojectpicker, And the DLL name is Microsoft. teamfoundation. Client. dll.
It contains tfsconnectdialog, such as: public class teamprojectpicker: idisposable {private tfsconnectdatasource m_datasource; private tfsconnectdialog m_internaldialog; private bool m_disposed; private canceleventhandler acceptbuttonclick ;..... }
Then, obtain the UI elements of tfsconnectdialog Based on the reflection and modify the settings.
TFS interface 2 Class Name: dialogchooseitemdll name: Microsoft. teamfoundation. versioncontrol. Controls. dll
It contains controlchooseitem, such as namespace Microsoft. teamfoundation. versioncontrol. controls {internal class dialogchooseitem: basedialog {private icontainer components; private button OK; private button cancel; private controlchooseitem chooseitem; private tablelayoutpanel okcanceltablelayoutpanel; private tablelayoutpanel overarchingtablelayoutpanel ;...........}}
Similarly, based on reflection, obtain the various UI elements of controlchooseitem, and then change the settings.

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.