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.