So, I think I answered my own question, but will share the results here for anyone else interested in this particular topic:
<span style=“font-family: “Courier New”; font-size: x-small;”> string predecessorString = “”;
<span style=“background-color: rgb(255, 255, 0); font-family: “Courier New”; font-size: x-small;”> foreach(TaskLink tl in project.TaskLinks)
<span style=“font-family: “Courier New”; font-size: x-small;”> {
<span style=“background-color: rgb(255, 255, 0); font-family: “Courier New”; font-size: x-small;”> if (tl.SuccTask.Equals(t))
<span style=“font-family: “Courier New”; font-size: x-small;”> {
<span style=“font-family: “Courier New”; font-size: x-small;”> predecessorString += “,”;
<span style=“background-color: rgb(255, 255, 0); font-family: “Courier New”; font-size: x-small;”> predecessorString += tl.PredTask.Get(Tsk.Id).ToString();//note ID, not Uid
<span style=“font-family: “Courier New”; font-size: x-small;”> switch (tl.LinkType)
<span style=“font-family: “Courier New”; font-size: x-small;”> {
<span style=“font-family: “Courier New”; font-size: x-small;”> case TaskLinkType.FinishToFinish:
<span style=“font-family: “Courier New”; font-size: x-small;”> predecessorString += “FF”;
<span style=“font-family: “Courier New”; font-size: x-small;”> break;
<span style=“font-family: “Courier New”; font-size: x-small;”> case TaskLinkType.FinishToStart:
<span style=“background-color: rgb(255, 255, 0); font-family: “Courier New”; font-size: x-small;”> predecessorString += “FS”;
<span style=“font-family: “Courier New”; font-size: x-small;”> break;
<span style=“font-family: “Courier New”; font-size: x-small;”> case TaskLinkType.StartToFinish:
<span style=“font-family: “Courier New”; font-size: x-small;”> predecessorString += “SF”;
<span style=“font-family: “Courier New”; font-size: x-small;”> break;
<span style=“font-family: “Courier New”; font-size: x-small;”> case TaskLinkType.StartToStart:
<span style=“font-family: “Courier New”; font-size: x-small;”> predecessorString += “SS”;
<span style=“font-family: “Courier New”; font-size: x-small;”> break;
<span style=“font-family: “Courier New”; font-size: x-small;”> }
<span style=“background-color: rgb(255, 255, 0); font-family: “Courier New”; font-size: x-small;”> double lag = tl.LinkLag / (10.0 * 60.0 * 8.0); //assume 8.0 hour day
<span style=“font-family: “Courier New”; font-size: x-small;”> if (lag < 0)
<span style=“font-family: “Courier New”; font-size: x-small;”> {
<span style=“font-family: “Courier New”; font-size: x-small;”> predecessorString += lag.ToString();
<span style=“font-family: “Courier New”; font-size: x-small;”> predecessorString += " days";
<span style=“font-family: “Courier New”; font-size: x-small;”> }
<span style=“font-family: “Courier New”; font-size: x-small;”> else if (lag > 0)
<span style=“font-family: “Courier New”; font-size: x-small;”> {
<span style=“background-color: rgb(255, 255, 0); font-family: “Courier New”; font-size: x-small;”> predecessorString += “+”;
<span style=“background-color: rgb(255, 255, 0); font-family: “Courier New”; font-size: x-small;”> predecessorString += lag.ToString();
<span style=“background-color: rgb(255, 255, 0); font-family: “Courier New”; font-size: x-small;”> predecessorString += " days"; //probably should be “day”<span style=“font-family: “Courier New”; font-size: x-small;”> }
<span style=“font-family: “Courier New”; font-size: x-small;”> }
<span style=“font-family: “Courier New”; font-size: x-small;”> }
<span style=“font-family: “Courier New”; font-size: x-small;”> if (predecessorString.Length > 1)
<span style=“font-family: “Courier New”; font-size: x-small;”> {
<span style=“font-family: “Courier New”; font-size: x-small;”> predecessorString = predecessorString.Substring(1); //remove leading comma