Moving Extensions into main so we don't break stuff (#6)

* Adding in exts

* modifying exts

* deleting outdated azure extentions

* removing x86
This commit is contained in:
Clint Rutkas
2024-08-29 12:34:56 -07:00
committed by GitHub
parent a0dd9d161f
commit 5e64ec219e
44 changed files with 243 additions and 870 deletions

View File

@@ -20,6 +20,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CmdPal.Extensions
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CmdPal.Common", "src\Microsoft.CmdPal.Common\Microsoft.CmdPal.Common.csproj", "{05CDE6EE-23AE-42AF-A9F5-E398C382675F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpongebotExtension", "extensions\SpongebotExtension\SpongebotExtension.csproj", "{57617906-DEC8-4D62-A270-6EBE3F8E5C0D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HackerNewsExtension", "extensions\HackerNewsExtension\HackerNewsExtension.csproj", "{1A506BBA-06A9-476E-B5D3-1495F299D53F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaControlsExtension", "extensions\MediaControlsExtension\MediaControlsExtension.csproj", "{D08AE85F-B6FE-4E1C-8402-DB396B70D6DA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProcessMonitorExtension", "extensions\ProcessMonitorExtension\ProcessMonitorExtension.csproj", "{9456257A-3292-4A8D-AF63-9830EABE7ED2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
@@ -88,6 +96,42 @@ Global
{05CDE6EE-23AE-42AF-A9F5-E398C382675F}.Release|ARM64.Build.0 = Release|arm64
{05CDE6EE-23AE-42AF-A9F5-E398C382675F}.Release|x64.ActiveCfg = Release|x64
{05CDE6EE-23AE-42AF-A9F5-E398C382675F}.Release|x64.Build.0 = Release|x64
{57617906-DEC8-4D62-A270-6EBE3F8E5C0D}.Debug|ARM64.ActiveCfg = Debug|ARM64
{57617906-DEC8-4D62-A270-6EBE3F8E5C0D}.Debug|ARM64.Build.0 = Debug|ARM64
{57617906-DEC8-4D62-A270-6EBE3F8E5C0D}.Debug|ARM64.Deploy.0 = Debug|ARM64
{57617906-DEC8-4D62-A270-6EBE3F8E5C0D}.Debug|x64.ActiveCfg = Debug|x64
{57617906-DEC8-4D62-A270-6EBE3F8E5C0D}.Debug|x64.Build.0 = Debug|x64
{57617906-DEC8-4D62-A270-6EBE3F8E5C0D}.Debug|x64.Deploy.0 = Debug|x64
{57617906-DEC8-4D62-A270-6EBE3F8E5C0D}.Release|ARM64.ActiveCfg = Release|ARM64
{57617906-DEC8-4D62-A270-6EBE3F8E5C0D}.Release|ARM64.Build.0 = Release|ARM64
{57617906-DEC8-4D62-A270-6EBE3F8E5C0D}.Release|ARM64.Deploy.0 = Release|ARM64
{57617906-DEC8-4D62-A270-6EBE3F8E5C0D}.Release|x64.ActiveCfg = Release|x64
{57617906-DEC8-4D62-A270-6EBE3F8E5C0D}.Release|x64.Build.0 = Release|x64
{57617906-DEC8-4D62-A270-6EBE3F8E5C0D}.Release|x64.Deploy.0 = Release|x64
{1A506BBA-06A9-476E-B5D3-1495F299D53F}.Debug|ARM64.ActiveCfg = Debug|ARM64
{1A506BBA-06A9-476E-B5D3-1495F299D53F}.Debug|ARM64.Build.0 = Debug|ARM64
{1A506BBA-06A9-476E-B5D3-1495F299D53F}.Debug|x64.ActiveCfg = Debug|x64
{1A506BBA-06A9-476E-B5D3-1495F299D53F}.Debug|x64.Build.0 = Debug|x64
{1A506BBA-06A9-476E-B5D3-1495F299D53F}.Release|ARM64.ActiveCfg = Release|ARM64
{1A506BBA-06A9-476E-B5D3-1495F299D53F}.Release|ARM64.Build.0 = Release|ARM64
{1A506BBA-06A9-476E-B5D3-1495F299D53F}.Release|x64.ActiveCfg = Release|x64
{1A506BBA-06A9-476E-B5D3-1495F299D53F}.Release|x64.Build.0 = Release|x64
{D08AE85F-B6FE-4E1C-8402-DB396B70D6DA}.Debug|ARM64.ActiveCfg = Debug|ARM64
{D08AE85F-B6FE-4E1C-8402-DB396B70D6DA}.Debug|ARM64.Build.0 = Debug|ARM64
{D08AE85F-B6FE-4E1C-8402-DB396B70D6DA}.Debug|x64.ActiveCfg = Debug|x64
{D08AE85F-B6FE-4E1C-8402-DB396B70D6DA}.Debug|x64.Build.0 = Debug|x64
{D08AE85F-B6FE-4E1C-8402-DB396B70D6DA}.Release|ARM64.ActiveCfg = Release|ARM64
{D08AE85F-B6FE-4E1C-8402-DB396B70D6DA}.Release|ARM64.Build.0 = Release|ARM64
{D08AE85F-B6FE-4E1C-8402-DB396B70D6DA}.Release|x64.ActiveCfg = Release|x64
{D08AE85F-B6FE-4E1C-8402-DB396B70D6DA}.Release|x64.Build.0 = Release|x64
{9456257A-3292-4A8D-AF63-9830EABE7ED2}.Debug|ARM64.ActiveCfg = Debug|ARM64
{9456257A-3292-4A8D-AF63-9830EABE7ED2}.Debug|ARM64.Build.0 = Debug|ARM64
{9456257A-3292-4A8D-AF63-9830EABE7ED2}.Debug|x64.ActiveCfg = Debug|x64
{9456257A-3292-4A8D-AF63-9830EABE7ED2}.Debug|x64.Build.0 = Debug|x64
{9456257A-3292-4A8D-AF63-9830EABE7ED2}.Release|ARM64.ActiveCfg = Release|ARM64
{9456257A-3292-4A8D-AF63-9830EABE7ED2}.Release|ARM64.Build.0 = Release|ARM64
{9456257A-3292-4A8D-AF63-9830EABE7ED2}.Release|x64.ActiveCfg = Release|x64
{9456257A-3292-4A8D-AF63-9830EABE7ED2}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -97,6 +141,10 @@ Global
{F5E5B8B9-7F51-43B8-ACED-1BD380BED98D} = {B7FF739F-7716-4FC3-B622-705486187B87}
{305DD37E-C85D-4B08-AAFE-7381FA890463} = {FAA24D36-5515-467C-91E7-101A189AAF48}
{79060D06-7174-4D66-8D0B-4FF021154049} = {FAA24D36-5515-467C-91E7-101A189AAF48}
{57617906-DEC8-4D62-A270-6EBE3F8E5C0D} = {B7FF739F-7716-4FC3-B622-705486187B87}
{1A506BBA-06A9-476E-B5D3-1495F299D53F} = {B7FF739F-7716-4FC3-B622-705486187B87}
{D08AE85F-B6FE-4E1C-8402-DB396B70D6DA} = {B7FF739F-7716-4FC3-B622-705486187B87}
{9456257A-3292-4A8D-AF63-9830EABE7ED2} = {B7FF739F-7716-4FC3-B622-705486187B87}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BC94BFC2-A741-4978-B6A4-9E01B7660E6B}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -1,204 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.Windows.DevPal.SDK;
using Windows.Foundation;
using Windows.Storage.Streams;
namespace AzureResourcesExtension;
internal sealed class AzureResourceItem
{
internal string Name { get; init; }
internal string Type { get; init; }
internal string ResourceGroup { get; init; }
internal string Id { get; init; }
internal string EscapedName => JsonEncodedText.Encode(Name).ToString();
internal string EscapedType => JsonEncodedText.Encode(Type).ToString();
internal string EscapedResourceGroup => JsonEncodedText.Encode(ResourceGroup).ToString();
}
internal sealed class AzureResourcesPage : IPage
{
internal List<AzureResourceItem> resources = new();
public IAsyncOperation<string> RenderToJson()
{
return AsyncInfo.Run(async cancellationToken =>
{
try
{
if (resources.Count == 0)
{
resources = await GetAzureResources();
}
var items = string.Join(", ", resources.Select(
(resource, index) => $$"""
{
"name": "{{resource.EscapedName}}",
"subtitle": "{{resource.EscapedType}}",
"description": "{{resource.EscapedResourceGroup}}",
"actions": [
{ "icon": "", "name": "Open in Azure Portal", "id": "AzureResource.OpenPortal.{{index}}" }
]
}
"""
));
var json = $$"""
{
"type": "list",
"items": [
{{items}}
]
}
""";
return json;
}
catch (Exception ex)
{
Debug.WriteLine($"Error in RenderToJson: {ex.Message}");
throw;
}
});
}
private static async Task<List<AzureResourceItem>> GetAzureResources()
{
var resources = new List<AzureResourceItem>();
try
{
var azPath = @"C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\az.cmd";
var processInfo = new ProcessStartInfo
{
FileName = azPath,
Arguments = "resource list -o json",
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true,
WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) // Set a valid working directory
};
using var process = Process.Start(processInfo);
var result = await process.StandardOutput.ReadToEndAsync();
process.WaitForExit();
var resourceList = JsonSerializer.Deserialize<List<AzureResource>>(result);
resources = resourceList.Select(resource => new AzureResourceItem
{
Name = resource.name,
Type = resource.type,
ResourceGroup = resource.resourceGroup,
Id = resource.id
}).ToList();
}
catch (Exception ex)
{
// return a really simple json in the proper format
return new List<AzureResourceItem>
{
new() {
Name = ex.Message,
Type = "Error",
ResourceGroup = ex.Message
}
};
}
return resources;
}
private sealed class AzureResource
{
public string name { get; set; }
public string type { get; set; }
public string resourceGroup { get; set; }
public string id { get; set; }
}
}
internal sealed class AzureResourcesCommand : ICommand
{
private readonly AzureResourcesPage _page = new();
public string Icon => "https://www.c-sharpcorner.com/UploadFile/BlogImages/01232023170209PM/Azure%20Icon.png";
public CommandType Kind => CommandType.List;
public string Name => "Azure Resources";
public string Subtitle => "";
public IPage Page => _page;
#pragma warning disable CS0067
public event TypedEventHandler<object, NavigateToCommandRequestedEventArgs> NavigateToCommandRequested;
#pragma warning restore
public IAsyncOperation<IReadOnlyList<ICommand>> GetCommandsForQueryAsync(string search) { return null; }
public IAsyncAction DoAction(string actionId)
{
return Task.Run(() =>
{
try
{
if (_page.resources.Count != 0)
{
var parts = actionId.Split('.');
if (parts.Length != 3)
{
return;
}
var index = int.Parse(parts[^1], null);
var action = parts[^2];
var resource = _page.resources[index];
if (action == "OpenPortal")
{
OpenResourceInAzurePortal(resource.Id);
}
}
}
catch (Exception ex)
{
Debug.WriteLine($"Error in DoAction: {ex.Message}");
throw;
}
}).AsAsyncAction();
}
private static void OpenResourceInAzurePortal(string resourceId)
{
var tenantId = Environment.GetEnvironmentVariable("AZURE_TENANT_ID");
if (string.IsNullOrEmpty(tenantId))
{
Debug.WriteLine("Environment variable AZURE_TENANT_ID is not set.");
return;
}
var url = $"https://portal.azure.com/#@{tenantId}/resource{resourceId}";
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
}
}
internal sealed class AzureResourcesCommandsProvider : ICommandsProvider
{
public string DisplayName => "Azure Resources Commands";
public string Icon => "";
public void Dispose() => throw new NotImplementedException();
public IAsyncOperation<IReadOnlyList<ICommand>> GetCommands()
{
var list = new List<ICommand>()
{
new AzureResourcesCommand()
};
return Task.FromResult(list as IReadOnlyList<ICommand>).AsAsyncOperation();
}
}

View File

@@ -1,55 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>AzureResourcesExtension</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &gt;= 8">win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &lt; 8">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>false</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
</PropertyGroup>
<ItemGroup>
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240607001" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.4" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\extensionsdk\Microsoft.Windows.DevPal.SDK.Lib\Microsoft.Windows.DevPal.SDK.Lib.csproj">
</ProjectReference>
</ItemGroup>
<!--
Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
Tools extension to be activated for this project even if the Windows App SDK Nuget
package has not yet been restored.
-->
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<ProjectCapability Include="Msix" />
</ItemGroup>
<!--
Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution
Explorer "Package and Publish" context menu entry to be enabled for this project even if
the Windows App SDK Nuget package has not yet been restored.
-->
<PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
</PropertyGroup>
</Project>

View File

@@ -1,78 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
xmlns:com="http://schemas.microsoft.com/appx/manifest/com/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap uap3 rescap">
<Identity
Name="AzureResourcesExtension"
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
Version="1.0.0.0" />
<Properties>
<DisplayName>AzureResources Sample Extension</DisplayName>
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="AzureResources Sample Extension"
Description="AzureResources Sample Extension"
BackgroundColor="transparent"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" />
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
<Extensions>
<com:Extension Category="windows.comServer">
<com:ComServer>
<com:ExeServer Executable="AzureResourcesExtension.exe" Arguments="-RegisterProcessAsComServer" DisplayName="AzureResourcesExtensionApp">
<com:Class Id="55B0369C-C696-42DD-A98F-31A3321B4E85" DisplayName="AzureResourcesExtension" />
</com:ExeServer>
</com:ComServer>
</com:Extension>
<uap3:Extension Category="windows.appExtension">
<uap3:AppExtension Name="com.microsoft.devpal"
Id="PG-SP-ID"
PublicFolder="Public"
DisplayName="AzureResources Sample"
Description="AzureResources Extension for Dev Pal">
<uap3:Properties>
<CmdPalProvider>
<Activation>
<CreateInstance ClassId="55B0369C-C696-42DD-A98F-31A3321B4E85" />
</Activation>
<SupportedInterfaces>
<Commands/>
</SupportedInterfaces>
</CmdPalProvider>
</uap3:Properties>
</uap3:AppExtension>
</uap3:Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>

View File

@@ -1,35 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Threading;
using Microsoft.Windows.DevPal.SDK;
namespace AzureResourcesExtension;
public class Program
{
[MTAThread]
public static void Main(string[] args)
{
if (args.Length > 0 && args[0] == "-RegisterProcessAsComServer")
{
using ExtensionServer server = new();
var extensionDisposedEvent = new ManualResetEvent(false);
var extensionInstance = new SampleExtension(extensionDisposedEvent);
// We are instantiating an extension instance once above, and returning it every time the callback in RegisterExtension below is called.
// This makes sure that only one instance of SampleExtension is alive, which is returned every time the host asks for the IExtension object.
// If you want to instantiate a new instance each time the host asks, create the new instance inside the delegate.
server.RegisterExtension(() => extensionInstance);
// This will make the main thread wait until the event is signalled by the extension class.
// Since we have single instance of the extension object, we exit as sooon as it is disposed.
extensionDisposedEvent.WaitOne();
}
else
{
Console.WriteLine("Not being launched as a Extension... exiting.");
}
}
}

View File

@@ -1,38 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Runtime.InteropServices;
using System.Threading;
using Microsoft.Windows.DevPal.SDK;
namespace AzureResourcesExtension;
[ComVisible(true)]
[Guid("55B0369C-C696-42DD-A98F-31A3321B4E85")]
[ComDefaultInterface(typeof(IExtension))]
public sealed class SampleExtension : IExtension
{
private readonly ManualResetEvent _extensionDisposedEvent;
public SampleExtension(ManualResetEvent extensionDisposedEvent)
{
this._extensionDisposedEvent = extensionDisposedEvent;
}
public object GetProvider(ProviderType providerType)
{
switch (providerType)
{
case ProviderType.Commands:
return new AzureResourcesCommandsProvider();
default:
return null;
}
}
public void Dispose()
{
this._extensionDisposedEvent.Set();
}
}

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="HackerNewsExtension.app"/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- The ID below informs the system that this application is compatible with OS features first introduced in Windows 10.
It is necessary to support features in unpackaged applications, for example the custom titlebar implementation.
For more info see https://docs.microsoft.com/windows/apps/windows-app-sdk/use-windows-app-sdk-run-time#declare-os-compatibility-in-your-application-manifest -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</windowsSettings>
</application>
</assembly>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -1,176 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Windows.Foundation;
using Microsoft.Windows.CommandPalette.Extensions;
using System.Diagnostics;
using System.Xml.Linq;
using System.Net.Http;
using Windows.Foundation.Collections;
using Microsoft.Windows.CommandPalette.Extensions.Helpers;
using System.Transactions;
using System.Runtime.CompilerServices;
using System.Text.Json;
using System.Globalization;
namespace GitHubExtension;
sealed class RepositoryInfo
{
public string name { get; set; }
public string nameWithOwner { get; set; }
}
sealed class GitHubIssue
{
public string title { get; set; }
public int number { get; set; }
public string url { get; set; }
public string state { get; set; }
public string body { get; set; }
// public RepositoryInfo repository { get; set; }
}
sealed class OpenIssueAction : InvokableCommand
{
private readonly GitHubIssue issue;
public OpenIssueAction(GitHubIssue issue)
{
this.issue = issue;
Name = "Open";
Icon = new("\uE8A7");
}
public override ICommandResult Invoke()
{
Process.Start(new ProcessStartInfo(issue.url) { UseShellExecute = true });
return ActionResult.KeepOpen();
}
}
sealed class ViewIssueAction : MarkdownPage {
static readonly string OpenImagePath = "https://github.com/user-attachments/assets/e4144bc6-91dc-4de8-acad-5ddf4e574edf";
static readonly string ClosedImagePath = "https://github.com/user-attachments/assets/b8cfaa2e-5407-4594-a50f-7f252d8f6baf";
private readonly GitHubIssue issue;
public ViewIssueAction(GitHubIssue issue)
{
this.issue = issue;
Name = "View";
this.Title = issue.title;
Icon = new(issue.state == "open" ? OpenImagePath : ClosedImagePath);
}
public override string[] Bodies()
{
return [issue.body];
}
}
sealed class GithubIssuesPage : ListPage {
public GithubIssuesPage()
{
this.Icon = new("https://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Github-desktop-logo-symbol.svg/240px-Github-desktop-logo-symbol.svg.png");
this.Name = "GitHub Issues";
this.ShowDetails = true;
}
public override ISection[] GetItems()
{
var t = DoGetItems();
t.ConfigureAwait(false);
return t.Result;
}
private async Task<ISection[]> DoGetItems()
{
List<GitHubIssue> items = await GetGitHubIssues();
this.Loading = false;
var s = new ListSection(){
Title = "Issues",
Items = items
.Select((issue) => new ListItem(new ViewIssueAction(issue)) {
Title=issue.title,
Subtitle=issue.number.ToString(CultureInfo.CurrentCulture),
Details = new Details() { Body = issue.body },
MoreCommands= [
new CommandContextItem(new OpenIssueAction(issue))
]
})
.ToArray()
};
return [ s ] ;
}
private static async Task<List<GitHubIssue>> GetGitHubIssues()
{
var issues = new List<GitHubIssue>();
string result;// = "";
string errorResult;// = "";
try
{
var ghPath = @"gh";
var processInfo = new ProcessStartInfo
{
FileName = ghPath,
Arguments = "search issues --author \"@me\" --limit 50 --json title,number,url,state,body",
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
CreateNoWindow = true,
WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) // Set a valid working directory
};
using var process = Process.Start(processInfo);
result = await process.StandardOutput.ReadToEndAsync();
errorResult = await process.StandardError.ReadToEndAsync();
process.WaitForExit();
if (process.ExitCode != 0) {
return new List<GitHubIssue> { new() { title = errorResult, number = -1, url = "" } };
}
issues = JsonSerializer.Deserialize<List<GitHubIssue>>(result);
}
catch (Exception ex)
{
return new List<GitHubIssue>
{
new() {
title = ex.Message,
number = -1,
url = ex.Message
}
};
}
return issues;
}
}
public class GithubActionsProvider : ICommandProvider
{
public string DisplayName => $"GitHub actions";
public IconDataType Icon => new("");
private readonly IListItem[] _Actions = [
new ListItem(new GithubIssuesPage()),
//new ListItem(new GitHubNotificationsPage()),
];
#pragma warning disable CA1816 // Dispose methods should call SuppressFinalize
public void Dispose() => throw new NotImplementedException();
#pragma warning restore CA1816 // Dispose methods should call SuppressFinalize
public IListItem[] TopLevelCommands()
{
return _Actions;
}
}

View File

@@ -1,54 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>GitHubExtension</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &gt;= 8">win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &lt; 8">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>false</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
</PropertyGroup>
<ItemGroup>
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK"/>
<PackageReference Include="Microsoft.Windows.CsWinRT"/>
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\extensionsdk\Microsoft.Windows.CommandPalette.Extensions.Helpers\Microsoft.Windows.CommandPalette.Extensions.Helpers.csproj" />
</ItemGroup>
<!--
Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
Tools extension to be activated for this project even if the Windows App SDK Nuget
package has not yet been restored.
-->
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<ProjectCapability Include="Msix" />
</ItemGroup>
<!--
Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution
Explorer "Package and Publish" context menu entry to be enabled for this project even if
the Windows App SDK Nuget package has not yet been restored.
-->
<PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
</PropertyGroup>
</Project>

View File

@@ -1,78 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
xmlns:com="http://schemas.microsoft.com/appx/manifest/com/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap uap3 rescap">
<Identity
Name="GitHubExtension"
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
Version="1.0.0.0" />
<Properties>
<DisplayName>GitHub Sample Extension</DisplayName>
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="GitHub Sample Extension"
Description="GitHub Sample Extension"
BackgroundColor="transparent"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" />
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
<Extensions>
<com:Extension Category="windows.comServer">
<com:ComServer>
<com:ExeServer Executable="GitHubExtension.exe" Arguments="-RegisterProcessAsComServer" DisplayName="GitHubExtensionApp">
<com:Class Id="9581429C-78F2-4879-A0A4-296261DF192B" DisplayName="GitHubExtension" />
</com:ExeServer>
</com:ComServer>
</com:Extension>
<uap3:Extension Category="windows.appExtension">
<uap3:AppExtension Name="com.microsoft.windows.commandpalette"
Id="PG-SP-ID"
PublicFolder="Public"
DisplayName="GitHub Extension Sample"
Description="GitHub Extension for Run">
<uap3:Properties>
<CmdPalProvider>
<Activation>
<CreateInstance ClassId="9581429C-78F2-4879-A0A4-296261DF192B" />
</Activation>
<SupportedInterfaces>
<Commands/>
</SupportedInterfaces>
</CmdPalProvider>
</uap3:Properties>
</uap3:AppExtension>
</uap3:Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>

View File

@@ -1,35 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Threading;
using Microsoft.Windows.CommandPalette.Extensions;
namespace GitHubExtension;
public class Program
{
[MTAThread]
public static void Main(string[] args)
{
if (args.Length > 0 && args[0] == "-RegisterProcessAsComServer")
{
using ExtensionServer server = new();
var extensionDisposedEvent = new ManualResetEvent(false);
var extensionInstance = new SampleExtension(extensionDisposedEvent);
// We are instantiating an extension instance once above, and returning it every time the callback in RegisterExtension below is called.
// This makes sure that only one instance of SampleExtension is alive, which is returned every time the host asks for the IExtension object.
// If you want to instantiate a new instance each time the host asks, create the new instance inside the delegate.
server.RegisterExtension(() => extensionInstance);
// This will make the main thread wait until the event is signalled by the extension class.
// Since we have single instance of the extension object, we exit as sooon as it is disposed.
extensionDisposedEvent.WaitOne();
}
else
{
Console.WriteLine("Not being launched as a Extension... exiting.");
}
}
}

View File

@@ -1,38 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Runtime.InteropServices;
using System.Threading;
using Microsoft.Windows.CommandPalette.Extensions;
namespace GitHubExtension;
[ComVisible(true)]
[Guid("9581429C-78F2-4879-A0A4-296261DF192B")]
[ComDefaultInterface(typeof(IExtension))]
public sealed class SampleExtension : IExtension
{
private readonly ManualResetEvent _extensionDisposedEvent;
public SampleExtension(ManualResetEvent extensionDisposedEvent)
{
this._extensionDisposedEvent = extensionDisposedEvent;
}
public object GetProvider(ProviderType providerType)
{
switch (providerType)
{
case ProviderType.Commands:
return new GithubActionsProvider();
default:
return null;
}
}
public void Dispose()
{
this._extensionDisposedEvent.Set();
}
}

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="GitHubExtension.app"/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- The ID below informs the system that this application is compatible with OS features first introduced in Windows 10.
It is necessary to support features in unpackaged applications, for example the custom titlebar implementation.
For more info see https://docs.microsoft.com/windows/apps/windows-app-sdk/use-windows-app-sdk-run-time#declare-os-compatibility-in-your-application-manifest -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</windowsSettings>
</application>
</assembly>

View File

@@ -1,13 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\Common.Dotnet.CsWinRT.props" />
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>HackerNewsExtension</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &gt;= 8">win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &lt; 8">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>false</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
@@ -24,15 +20,12 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK"/>
<PackageReference Include="Microsoft.Windows.CsWinRT"/>
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\extensionsdk\Microsoft.Windows.CommandPalette.Extensions.Helpers\Microsoft.Windows.CommandPalette.Extensions.Helpers.csproj">
</ProjectReference>
<ProjectReference Include="..\..\extensionsdk\Microsoft.Windows.CommandPalette.Extensions.Helpers\Microsoft.CmdPal.Extensions.Helpers.csproj" />
</ItemGroup>
<!--

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>ARM64</Platform>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>x64</Platform>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,10 @@
{
"profiles": {
"HackerNewsExtension (Package)": {
"commandName": "MsixPackage"
},
"HackerNewsExtension (Unpackaged)": {
"commandName": "Project"
}
}
}

View File

@@ -1,13 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\Common.Dotnet.CsWinRT.props" />
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>MediaControlsExtension</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &gt;= 8">win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &lt; 8">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>false</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
@@ -24,14 +20,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK"/>
<PackageReference Include="Microsoft.Windows.CsWinRT"/>
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\extensionsdk\Microsoft.Windows.CommandPalette.Extensions.Helpers\Microsoft.Windows.CommandPalette.Extensions.Helpers.csproj" />
<ProjectReference Include="..\..\extensionsdk\Microsoft.Windows.CommandPalette.Extensions.Helpers\Microsoft.CmdPal.Extensions.Helpers.csproj" />
</ItemGroup>
<!--

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>ARM64</Platform>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>x64</Platform>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,10 @@
{
"profiles": {
"MediaControlsExtension (Package)": {
"commandName": "MsixPackage"
},
"MediaControlsExtension (Unpackaged)": {
"commandName": "Project"
}
}
}

View File

@@ -1,13 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\Common.Dotnet.CsWinRT.props" />
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>ProcessMonitorExtension</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &gt;= 8">win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &lt; 8">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>false</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
@@ -24,14 +20,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK"/>
<PackageReference Include="Microsoft.Windows.CsWinRT"/>
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\extensionsdk\Microsoft.Windows.CommandPalette.Extensions.Helpers\Microsoft.Windows.CommandPalette.Extensions.Helpers.csproj">
<ProjectReference Include="..\..\extensionsdk\Microsoft.Windows.CommandPalette.Extensions.Helpers\Microsoft.CmdPal.Extensions.Helpers.csproj">
</ProjectReference>
</ItemGroup>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>ARM64</Platform>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>x64</Platform>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,10 @@
{
"profiles": {
"ProcessMonitorExtension (Package)": {
"commandName": "MsixPackage"
},
"ProcessMonitorExtension (Unpackaged)": {
"commandName": "Project"
}
}
}

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>ARM64</Platform>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>x64</Platform>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,10 @@
{
"profiles": {
"SpongebotExtension (Package)": {
"commandName": "MsixPackage"
},
"SpongebotExtension (Unpackaged)": {
"commandName": "Project"
}
}
}

View File

@@ -1,13 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\Common.Dotnet.CsWinRT.props" />
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>SpongebotExtension</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &gt;= 8">win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &lt; 8">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>false</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
@@ -24,15 +20,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK"/>
<PackageReference Include="Microsoft.Windows.CsWinRT"/>
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\extensionsdk\Microsoft.Windows.CommandPalette.Extensions.Helpers\Microsoft.Windows.CommandPalette.Extensions.Helpers.csproj">
</ProjectReference>
<ProjectReference Include="..\..\extensionsdk\Microsoft.Windows.CommandPalette.Extensions.Helpers\Microsoft.CmdPal.Extensions.Helpers.csproj" />
</ItemGroup>
<!--

View File

@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\ToolingVersions.props" />
<Import Project="..\..\..\..\Common.Dotnet.CsWinRT.props" />
<PropertyGroup>
<OutputType>WinExe</OutputType>