Book Image

Team Foundation Server 2015 Customization

By : Gordon Beeming
Book Image

Team Foundation Server 2015 Customization

By: Gordon Beeming

Overview of this book

Table of Contents (17 chapters)
Team Foundation Server 2015 Customization
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Implementation


The code for a check-in policy is really simple:

  1. First, make the BigChangesCheckInPolicy class inherit from PolicyBase:

    public class BigChangesCheckInPolicy : PolicyBase
    {
    }
  2. You will also need to add the following using statement:

    using Microsoft.TeamFoundation.VersionControl.Client;
  3. Now, we'll implement the methods that are required by the abstract methods in PolicyBase. Let's first use the following code to describe our policy:

    public override string Description => 
          "The Big Changes Checkin Policy makes sure that if you "+
          "make lots of changes you are adding a work item to "+
          "the check-in";
    public override string Type =>
          "Big Changes Checkin Policy [Dialog Box]";
    public override string TypeDescription =>
          "The Big Changes Checkin Policy makes sure that if you " +
          "make lots of changes you are adding a work item to " +
          "the check-in [Dialog Box]";
    public override bool Edit(IPolicyEditArgs policyEditArgs) => 
              true...