当前位置: 首页>>代码示例>>C#>>正文


C# ItemCollection.MoveCurrentToPrevious方法代码示例

本文整理汇总了C#中System.Windows.Controls.ItemCollection.MoveCurrentToPrevious方法的典型用法代码示例。如果您正苦于以下问题:C# ItemCollection.MoveCurrentToPrevious方法的具体用法?C# ItemCollection.MoveCurrentToPrevious怎么用?C# ItemCollection.MoveCurrentToPrevious使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.ItemCollection的用法示例。


在下文中一共展示了ItemCollection.MoveCurrentToPrevious方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Draw


//.........这里部分代码省略.........
                        new Run("Date: ") {FontWeight = FontWeights.Bold},
                        new Run(commit.FormattedDate),
                        new LineBreak(),
                        new LineBreak(),
                        new Run(commit.Description.TrimEnd())
                    });

                    dot.ToolTip = commitTooltip;
                    ToolTipService.SetShowDuration(dot, 60000);
                    ToolTipService.SetInitialShowDelay(dot, 1);
                }

                if (commit.Branches.Count > 0)
                {
                    // Draw the line to the parent dot(s)/commit(s).
                    foreach (string hash in commit.ParentHashes)
                    {
                        // Retrieve the parent commit dot position.
                        var positions = commitDotPositions.Where(o => o.Key == hash);

                        if (positions.Count() > 0)
                        {
                            int[] parentPosition = commitDotPositions.Where(o => o.Key == hash).First().Value;

                            Brush lineColor = BranchColors[commit.Branches.ElementAt(0).Name];

                            // Calculate line positions.
                            float startLineX1 = dotX + dotSize / 2;
                            float startLineY1 = dotY + dotSize / 2;
                            float endLineX2 = parentPosition[0] + dotSize / 2;
                            float endLineY2 = parentPosition[1] + dotSize / 2;
                            float startLineX2;
                            float startLineY2;
                            float endLineX1;
                            float endLineY1;

                            if (commit.IsMergeCommit())
                            {
                                startLineX2 = endLineX2;
                                startLineY2 = startLineY1;

                                endLineX1 = endLineX2;
                                endLineY1 = startLineY1;
                            }
                            else
                            {
                                startLineX2 = startLineX1;
                                startLineY2 = parentPosition[1] - cellHeight / 2 + dotSize / 2 + 6;

                                endLineX1 = startLineX1;
                                endLineY1 = parentPosition[1] - cellHeight / 2 + dotSize / 2 + 12;
                            }

                            // Construct and draw the line path.
                            Path path = new Path
                            {
                                Stroke = lineColor,
                                StrokeThickness = 4,
                                Data = new PathGeometry
                                {
                                    Figures = new PathFigureCollection
                                    {
                                        new PathFigure
                                        {
                                            StartPoint = new Point(startLineX1, startLineY1),
                                            Segments = new PathSegmentCollection
                                            {
                                                new PolyBezierSegment
                                                {
                                                    Points = new PointCollection
                                                    {
                                                        new Point(startLineX2, startLineY2),
                                                        new Point(endLineX1, endLineY1),
                                                        new Point(endLineX2, endLineY2)
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            };

                            graph.Children.Add(path);

                            path.ToolTip = pathTooltip;
                            ToolTipService.SetShowDuration(path, 60000);
                            ToolTipService.SetInitialShowDelay(path, 1);
                        }
                    }
                }

                commitList.MoveCurrentToPrevious();
                if (commitList.IsCurrentBeforeFirst)
                {
                    break;
                }
            }

            repo.Dispose();
        }
开发者ID:jez9999,项目名称:Git-GUI,代码行数:101,代码来源:ChangesetGraph.cs


注:本文中的System.Windows.Controls.ItemCollection.MoveCurrentToPrevious方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。