Like I promised last week I updated the sample code that I posted for a check-in policy on source code documentation generation.
The following changes have been made to the API:
The IPolicyDefinition interface has an additional property CanEdit of type bool and a different signature for the Edit method. The edit method is now only called when you return true for the property CanEdit. The signature change for the Edit method is not so shocking. It changed from
public bool Edit(System.Windows.Forms.IWin32Window parent,
public bool Edit(IPolicyEditArgs policyEditArgs)
And as you might guess the policyEditArgs argument contains the member parent of the type IWin32Window to show the dialog and the IServiceProvider interface is now already factored the way you need it with information on the team project the policy is activated on. (this gives you an easy way to talk back to the Team foundation server to get additional information to enforce your policy.)
The IPolicyEvaluation interface did not change.
The only other thing changed is the registry location of the policy registration. It was first at HKEY_LOCAL_MACHINESOFTWAREMicrosoftHatterasCheckin Policies
Now you need to do the exact same registration at:
Oh, and before I forget, the reference you set has of course changed as well. Previously you needed to reference the assembly Microsoft.visualStudio.Hatteras.Client.dll.
Now this needs to be Microsoft.TeamFoundation.VersionControl.Client.dll found in the same folder (c:program filesMicrosoft visual studio 8commonideprivateAssemblies)
Hope this helps you update your own policies as well.