public void Link(int parent, int child, String linkType) { try { Console.WriteLine(String.Format("正在关联{0}--{1}", parent, child)); WorkItemLinkTypeEnd linkTypeEnd = ItemStore.WorkItemLinkTypes.LinkTypeEnds[linkType]; Item = ItemStore.GetWorkItem(parent); Item.Links.Add(new RelatedLink(linkTypeEnd, child)); Item.Save(); } catch { Console.WriteLine(String.Format("{0}--{1}关联已存在", parent, child)); } }