mmanela / diffplex

DiffPlex is Netstandard 1.0+ C# library to generate textual diffs.
Apache License 2.0
996 stars 183 forks source link

Add context menu for WPF controls #76

Closed kingcean closed 3 years ago

kingcean commented 3 years ago

Line context menu

Allow you copy a specific line from context menu.

  1. Right click the text.
  2. Click Copy this line in the context menu.

Context menu of a line

Applied to following controls.

View mode context menu

You can right click the header to popup the context menu to select following actions.

Context menu of header

Applied to following controls.

WinForms demo

This PR also updates the WinForms demo by WPF element host implementation as I mentioned in #51 issue. It can be used in control or window of WinForms project and looks exactly as same as the one in WPF.

kingcean commented 3 years ago

And of course, all headers of these menu items can be modified by setting the related properties. The WPF controls project targets .NET 5, .NET Core 3.1 and .NET Framework 4.6 now. And I have enhanced the member method GoTo to support DiffPiece instance as parameter as well as the zero-based line index already supported.