LoadContextMenus(Result selectedResult)
+ {
+ if (selectedResult.ContextData is not CodeContainer container)
+ {
+ return [];
+ }
+
+ return
+ [
+ new()
+ {
+ Title = "Run as administrator (Ctrl+Shift+Enter)",
+ Glyph = "\xE7EF",
+ FontFamily = "Segoe Fluent Icons,Segoe MDL2 Assets",
+ AcceleratorKey = Key.Enter,
+ AcceleratorModifiers = ModifierKeys.Control | ModifierKeys.Shift,
+ PluginName = Name,
+ Action = _ =>
+ {
+ Helper.OpenInShell(
+ container.InstancePath,
+ $"\"{container.FullPath}\"",
+ runAs: Helper.ShellRunAsType.Administrator);
+ return true;
+ },
+ },
+
+ new()
+ {
+ Title = "Open containing folder (Ctrl+Shift+E)",
+ Glyph = "\xE838",
+ FontFamily = "Segoe Fluent Icons,Segoe MDL2 Assets",
+ AcceleratorKey = Key.E,
+ AcceleratorModifiers = ModifierKeys.Control | ModifierKeys.Shift,
+ PluginName = Name,
+ Action = _ =>
+ {
+ Helper.OpenInShell(Path.GetDirectoryName(container.FullPath));
+ return true;
+ },
+ }
+
+ ];
+ }
+
+ ///
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ ///
+ /// Wrapper method for that dispose additional objects and events form the plugin itself.
+ ///
+ /// Indicate that the plugin is disposed.
+ private void Dispose(bool disposing)
+ {
+ if (Disposed || !disposing)
+ {
+ return;
+ }
+
+ Disposed = true;
+ }
+
+ // TODO: Move this class to a separate file
+ private class CodeContainer(string fullPath, string instancePath, DateTime lastOpened)
+ {
+ public string FullPath { get; } = fullPath;
+
+ public string InstancePath { get; } = instancePath;
+
+ public DateTime LastOpened { get; } = lastOpened;
+ }
+ }
+}
diff --git a/Community.PowerToys.Run.Plugin.RiderProjects/plugin.json b/Community.PowerToys.Run.Plugin.RiderProjects/plugin.json
new file mode 100644
index 0000000..95ca857
--- /dev/null
+++ b/Community.PowerToys.Run.Plugin.RiderProjects/plugin.json
@@ -0,0 +1,14 @@
+{
+ "ID": "62D86F0E2E9D45BFA0E067CD14694EC2",
+ "ActionKeyword": "^",
+ "IsGlobal": false,
+ "Name": "RiderProjects",
+ "Author": "mphojele",
+ "Version": "0.1.0",
+ "Language": "csharp",
+ "Website": "https://github.com/mphojele/Powertoys-Run-RiderProjects",
+ "ExecuteFileName": "Community.PowerToys.Run.Plugin.RiderProjects.dll",
+ "IcoPathDark": "Images\\riderprojects.dark.png",
+ "IcoPathLight": "Images\\riderprojects.light.png",
+ "DynamicLoading": true
+}
diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 0000000..9aaa859
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,10 @@
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
\ No newline at end of file
diff --git a/GlobalSuppressions.cs b/GlobalSuppressions.cs
new file mode 100644
index 0000000..c2e2109
--- /dev/null
+++ b/GlobalSuppressions.cs
@@ -0,0 +1,13 @@
+// Copyright (c) Mpho Jele. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// This file is used by Code Analysis to maintain SuppressMessage
+// attributes that are applied to this project.
+// Project-level suppressions either have no target or are given
+// a specific target and scoped to a namespace, type, member, etc.
+// Most of these rules are coming from PowerToys own GlobalSuppressions.cs
+using System.Diagnostics.CodeAnalysis;
+
+[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1309:FieldNamesMustNotBeginWithUnderscore", Justification = "We follow the C# Core Coding Style which uses underscores as prefixes rather than using `this.`.")]
+[assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1101:PrefixLocalCallsWithThis", Justification = "We follow the C# Core Coding Style which avoids using `this` unless absolutely necessary.")]
+[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1652:Enable XML documentation output", Justification = "We do not want to enable XML documentation output ;-)")]
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..25a97d6
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) Mpho Jele. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..7376af9
--- /dev/null
+++ b/README.md
@@ -0,0 +1,25 @@
+
+
+# PowerToys Run - Rider Projects Plugin
+
+[![Maintainability](https://api.codeclimate.com/v1/badges/4a9107e36ba549e8691e/maintainability)](https://codeclimate.com/github/khensunny/PowerToys-Run-RiderProjects/maintainability)
+[![GitHub repo size](https://img.shields.io/github/repo-size/khensunny/PowerToys-Run-RiderProjects)](#)
+
+[![Build](https://github.com/khensunny/PowerToys-Run-RiderProjects/actions/workflows/build.yml/badge.svg)](https://github.com/khensunny/PowerToys-Run-RiderProjects/actions/workflows/build.yml)
+[![GitHub release (release name instead of tag name)](https://img.shields.io/github/v/release/khensunny/PowerToys-Run-RiderProjects)](https://github.com/khensunny/PowerToys-Run-RiderProjects/releases/latest)
+
+
+
+This plugin adds Jetbrains Rider projects results to PowerToys Run.
+It has been developed and tested with Rider `2024.2.4` and PowerToys `v0.84.1`.
+
+#### Prerequisites
+1) [Install PowerToys](https://docs.microsoft.com/en-us/windows/powertoys/install)
+
+#### Install instructions
+1) Manual Installation (ZIP) : [Download from release page](https://github.com/khensunny/PowerToys-Run-RiderProjects/releases/latest)
+
+[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/khensunny)
+
+
+https://github.com/khensunny/PowerToys-Run-RiderProjects/blob/main/docs/ptr-riderprojects-demo.mp4
\ No newline at end of file
diff --git a/RiderProjects.sln b/RiderProjects.sln
new file mode 100644
index 0000000..d1b5865
--- /dev/null
+++ b/RiderProjects.sln
@@ -0,0 +1,40 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.10.35027.167
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.PowerToys.Run.Plugin.RiderProjects", "Community.PowerToys.Run.Plugin.RiderProjects\Community.PowerToys.Run.Plugin.RiderProjects.csproj", "{C32F81B1-BE7A-42B1-9731-1046F0A6B0AD}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.PowerToys.Run.Plugin.RiderProjects.UnitTests", "Community.PowerToys.Run.Plugin.RiderProjects.UnitTests\Community.PowerToys.Run.Plugin.RiderProjects.UnitTests.csproj", "{E3D9EA13-3B1E-487D-9219-18DEB9C87220}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM64 = Debug|ARM64
+ Debug|x64 = Debug|x64
+ Release|ARM64 = Release|ARM64
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C32F81B1-BE7A-42B1-9731-1046F0A6B0AD}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {C32F81B1-BE7A-42B1-9731-1046F0A6B0AD}.Debug|ARM64.Build.0 = Debug|ARM64
+ {C32F81B1-BE7A-42B1-9731-1046F0A6B0AD}.Debug|x64.ActiveCfg = Debug|x64
+ {C32F81B1-BE7A-42B1-9731-1046F0A6B0AD}.Debug|x64.Build.0 = Debug|x64
+ {C32F81B1-BE7A-42B1-9731-1046F0A6B0AD}.Release|ARM64.ActiveCfg = Release|ARM64
+ {C32F81B1-BE7A-42B1-9731-1046F0A6B0AD}.Release|ARM64.Build.0 = Release|ARM64
+ {C32F81B1-BE7A-42B1-9731-1046F0A6B0AD}.Release|x64.ActiveCfg = Release|x64
+ {C32F81B1-BE7A-42B1-9731-1046F0A6B0AD}.Release|x64.Build.0 = Release|x64
+ {E3D9EA13-3B1E-487D-9219-18DEB9C87220}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {E3D9EA13-3B1E-487D-9219-18DEB9C87220}.Debug|ARM64.Build.0 = Debug|ARM64
+ {E3D9EA13-3B1E-487D-9219-18DEB9C87220}.Debug|x64.ActiveCfg = Debug|x64
+ {E3D9EA13-3B1E-487D-9219-18DEB9C87220}.Debug|x64.Build.0 = Debug|x64
+ {E3D9EA13-3B1E-487D-9219-18DEB9C87220}.Release|ARM64.ActiveCfg = Release|ARM64
+ {E3D9EA13-3B1E-487D-9219-18DEB9C87220}.Release|ARM64.Build.0 = Release|ARM64
+ {E3D9EA13-3B1E-487D-9219-18DEB9C87220}.Release|x64.ActiveCfg = Release|x64
+ {E3D9EA13-3B1E-487D-9219-18DEB9C87220}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {FF666520-8AC9-4276-9762-0EA94991801B}
+ EndGlobalSection
+EndGlobal
diff --git a/StyleCop.json b/StyleCop.json
new file mode 100644
index 0000000..ce8fb9f
--- /dev/null
+++ b/StyleCop.json
@@ -0,0 +1,20 @@
+{
+ "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
+ "settings": {
+ "documentationRules": {
+ "xmlHeader": false,
+ "companyName": "Mpho Jele",
+ "copyrightText": "Copyright (c) {companyName}. All rights reserved.\nLicensed under the MIT license. See LICENSE file in the project root for full license information.",
+ "documentExposedElements": false,
+ "documentInterfaces": false,
+ "documentInternalElements": false
+ },
+ "layoutRules": {
+ "newlineAtEndOfFile": "require"
+ },
+ "orderingRules": {
+ "usingDirectivesPlacement": "outsideNamespace",
+ "systemUsingDirectivesFirst": true
+ }
+ }
+}