protected override int drawLabel(int x, int y, GitSharp.Core.Ref @ref) { var child = new TextBlock { Text = @ref.Name, Width = 100, TextTrimming = TextTrimming.CharacterEllipsis, Background = Brushes.CornflowerBlue, Tag = @ref }; child.SetValue(Canvas.LeftProperty, (double)x); child.SetValue(Canvas.TopProperty, (double)y - TEXT_OFFSET + VerticalOffset); child.PreviewMouseDown += OnLabelClick; Canvas.Children.Add(child); return(102); // <--- returning with of label }
internal Branch(Repository repo, CoreRef @ref) : this(repo, @ref.Name) { }
internal Commit(Repository repo, CoreRef @ref) : base(repo, @ref.ObjectId) { }
internal Tag(Repository repo, CoreRef @ref) : base(repo, @ref.ObjectId) { _name = @ref.Name; }
private string _name; // <--- need the name for resolving purposes only. once the internal tag is resolved, this field is not used any more. internal Tag(Repository repo, CoreRef @ref) : base(repo, @ref.ObjectId) { _name = @ref.Name; }
private void OnLabelClicked(GitSharp.Core.Ref @ref) { string text = @ref.Name; MessageBox.Show(text, "详细信息"); }
private void OnLabelClicked(GitSharp.Core.Ref @ref) { }