How to automatically populate the comments section


One of the questions on the alias today was "How to automatically populate the comments section"

Ed Hintz (of the MSSCI provider fame) posted this code as a sample:

IPendingCheckin m_pendingCheckin;

Initialize(IPendingCheckin pendingCheckin)

{

   m_pendingCheckin = pendingCheckin;

}

PolicyFailure[] Evaluate()

{

                // Code to get list of checked pending changes from m_pendingCheckin and

                // extract tagged comments string would need to be placed here

                m_pendingCheckin.PendingChanges.Comment = “Your extracted tagged comments go here”;

}

 

Brian pointed this  checkin policy is evaluated many times so buyer beware to perf impact