private static void CreateDependencyText(TextBlock txtBlock, ref string ids, WorkItemLinkInfo link, WorkItem teamIterationWorkItem) { if (link.LinkTypeId == -3) { var relWi = GetWiFromBoard(link.TargetId); if (relWi == null) { relWi = _tfs.GetWorkItem(link.TargetId.ToString()); } if (teamIterationWorkItem.AreaId != relWi.AreaId) // only if dependency is from another team { txtBlock.Inlines.Add(new System.Windows.Documents.Run { Background = Brushes.Blue, Foreground = Brushes.White, FontFamily = new FontFamily("Comic Sans"), Text = System.Environment.NewLine + link.TargetId + " |" + relWi.Type.Name + "| " + relWi.IterationPath }); txtBlock.Background = Brushes.Pink; ids += link.TargetId + " "; if (!_dependencies.ContainsKey(teamIterationWorkItem.AreaPath)) { _dependencies.Add(teamIterationWorkItem.AreaPath, new List <KeyValuePair <string, string> >()); } _dependencies[teamIterationWorkItem.AreaPath].Add(new KeyValuePair <string, string>(relWi.AreaPath, link.TargetId.ToString())); } } if (link.LinkTypeId == 3 && LoadSuccesors) { var relWi = GetWiFromBoard(link.TargetId); if (relWi == null) { relWi = _tfs.GetWorkItem(link.TargetId.ToString()); } if (teamIterationWorkItem.AreaId != relWi.AreaId) // only if dependency is from another team { txtBlock.Inlines.Add(new System.Windows.Documents.Run { Background = Brushes.MidnightBlue, Foreground = Brushes.Pink, FontFamily = new FontFamily("Comic Sans"), Text = System.Environment.NewLine + link.TargetId + " |" + relWi.Type.Name + "| " + relWi.IterationPath }); txtBlock.Background = Brushes.Pink; ids += link.TargetId + " "; } } }
static void miOpen_Click(object sender, RoutedEventArgs e) { var src = e.Source as FrameworkElement; if (src != null) { int id = (int)src.Tag; if (id > 0) { var wi = _tfs.GetWorkItem(id.ToString()); if (wi != null) { ShowWorkItem(wi, id + " (Readonly)"); } } } }