TFS API를 사용하여 파일 세트에 레이블을 추가하고 싶습니다. 내 코드는 다음과 같습니다TFS API를 사용하여 파일에 레이블을 추가하는 가장 좋은 방법은 무엇입니까?
VersionControlLabel label = new VersionControlLabel(this.vcServer, this.label,
this.vcServer.AuthenticatedUser, this.labelScopeDirectory, this.labelComment);
List<LabelItemSpec> labelSpecs = new List<LabelItemSpec>();
// iterate files and versions
foreach (var fileAndVersion in this.filesAndVersions)
{
VersionSpec vs = null;
Item i = null;
// i have no idea why the itemspec is needed instead of the item and version...
ItemSpec iSpec = new ItemSpec("{0}/{1}".FormatString(this.source, fileAndVersion.Key), RecursionType.None);
GetItemAndVersionSpec(fileAndVersion.Key, fileAndVersion.Value, out vs, out i);
labelSpecs.Add(new LabelItemSpec(iSpec, vs, false));
}
this.vcServer.CreateLabel(label, labelSpecs.ToArray(), LabelChildOption.Merge);
나에 관한 건은 MSDN docs에서이 같은 것들이다 (이 몇 가지 확장 방법은 ...이 모두 크게 this blog post에서이 상승된다) :
This enumeration supports the .NET Framework infrastructure
and is not intended to be used directly from your code.
그래서 MSDN에서 열거 형 (LabelChildOption)을 사용하지 말라고 말합니다.이 레이블은 afaik가 레이블을 만들어 파일에 추가하는 유일한 방법입니다.
더 좋은 방법이 있습니까? TFS API에서 일종의 "회색"영역입니까?