-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Navigate visible history #3591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigate visible history #3591
Changes from all commits
a8def5b
74f4fdb
6b91fc3
ab2ff5a
6a10b33
af73e85
7f75589
c80c7de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |||||||||||||||||||||||||||||||||||||||||||||
| // DEALINGS IN THE SOFTWARE. | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| using System; | ||||||||||||||||||||||||||||||||||||||||||||||
| using System.Collections; | ||||||||||||||||||||||||||||||||||||||||||||||
| using System.Windows.Data; | ||||||||||||||||||||||||||||||||||||||||||||||
| using System.Windows.Input; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -41,4 +42,10 @@ public interface IProvideParameterBinding | |||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| Binding ParameterBinding { get; } | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| public interface IProvideParameterList | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| IEnumerable ParameterList { get; } | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+45
to
+48
|
||||||||||||||||||||||||||||||||||||||||||||||
| public interface IProvideParameterList | |
| { | |
| IEnumerable ParameterList { get; } | |
| /// <summary> | |
| /// Provides a list of parameters for use in toolbar dropdown menus. | |
| /// Implement this interface when you want to supply a list of selectable parameters | |
| /// (e.g., for a toolbar dropdown) and provide display text for each parameter. | |
| /// </summary> | |
| public interface IProvideParameterList | |
| { | |
| /// <summary> | |
| /// Gets the list of parameters to be displayed in the dropdown menu. | |
| /// </summary> | |
| IEnumerable ParameterList { get; } | |
| /// <summary> | |
| /// Returns the display text for the specified parameter. | |
| /// </summary> | |
| /// <param name="parameter">The parameter for which to get the display text.</param> | |
| /// <returns>A string representing the display text for the parameter.</returns> |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,16 +16,20 @@ | |||||
| // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||||
| // DEALINGS IN THE SOFTWARE. | ||||||
|
|
||||||
| using System; | ||||||
| using System.ComponentModel; | ||||||
| using System.Composition; | ||||||
| using System.Linq; | ||||||
| using System.Windows; | ||||||
| using System.Windows.Controls; | ||||||
| using System.Windows.Controls.Primitives; | ||||||
| using System.Windows.Data; | ||||||
| using System.Windows.Input; | ||||||
| using System.Windows.Media; | ||||||
| using System.Windows.Threading; | ||||||
|
|
||||||
| using ICSharpCode.ILSpy.Themes; | ||||||
| using ICSharpCode.ILSpyX.TreeView; | ||||||
|
|
||||||
| using TomsToolbox.Composition; | ||||||
|
|
||||||
|
|
@@ -85,7 +89,8 @@ static void InitToolbar(ToolBar toolBar, IExportProvider exportProvider) | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| static Button CreateToolbarItem(IExport<ICommand, IToolbarCommandMetadata> commandExport) | ||||||
|
|
||||||
| static UIElement CreateToolbarItem(IExport<ICommand, IToolbarCommandMetadata> commandExport) | ||||||
| { | ||||||
| var command = commandExport.Value; | ||||||
|
|
||||||
|
|
@@ -108,9 +113,106 @@ static Button CreateToolbarItem(IExport<ICommand, IToolbarCommandMetadata> comma | |||||
| parameterBinding.ParameterBinding); | ||||||
| } | ||||||
|
|
||||||
| if (command is IProvideParameterList parameterList) | ||||||
|
||||||
| if (command is IProvideParameterList parameterList) | |
| if (command is IProvideParameterList) |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded limit of 20 items should be extracted as a named constant at the class level for better maintainability. This makes it easier to adjust the limit and makes the purpose clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably should check
Kindinstead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GetModuleDefinition throws on non-null DebugMetadataHeader, so that felt like an appropriate check before invoking it.
I don't mind changing it to Kind check, but I would need some hint about which Kinds guarantee DebugMetadataHeader, as I don't know how to produce e.g. WebCIL to check.