You just need to replace the WorkItemPolicy
in the example with your policy:
For example:
var myPolicy = new MyPolicy();
foreach (PolicyType policyType in Workstation.Current.InstalledPolicyTypes)
{
if (policyType.Name == myPolicy.Type)
{
teamProject.SetCheckinPolicies(
new PolicyEnvelope[]
{
new PolicyEnvelope(myPolicy, policyType)
});
break;
}
}
You may need to add a reference to the assembly containing your policy if you do not have it in you Console Application.