简体   繁体   中英

TFS Version Control Item extensions

is it possible to extend a TFS Version Control Item with custom fields or properties? Most entries found are about custom properties on TFS Work Items.

I want to keep a version control Item linked to a record in a database, using a set of custom properties that contain the db/table/primary key of the record.

Thanks, Rine

Team Foundation Server 2010 introduced a new feature called 'Properties'. Almost every item in TFS, be it a version control file/branch, or a work item can have a property bag associated with it.

What is missing from TFS 2010, is a generic UI to view/set these properties, however you can use the TFS Object Model to view/set them yourself.

For more information, see the following links:

You delete a property by setting its value to null.

public static void DeleteGenericProperty( this IPropertyService propertyService, 
    string moniker, string propertyName, int version = 1 )
{
     var artifactSpec = new ArtifactSpec(ArtifactKinds.Generic, moniker, version);
     propertyService.SetProperty(artifactSpec, propertyName, (string) null);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM