mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
|
|
// Copyright (c) Microsoft Corporation
|
|||
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|||
|
|
// See the LICENSE file in the project root for more information.
|
|||
|
|
|
|||
|
|
using System;
|
|||
|
|
using System.IO;
|
|||
|
|
using Microsoft.UI.Xaml.Media.Imaging;
|
|||
|
|
|
|||
|
|
// using Wox.Infrastructure.Image;
|
|||
|
|
namespace Microsoft.CmdPal.Ext.WindowsTerminal;
|
|||
|
|
|
|||
|
|
public class TerminalPackage
|
|||
|
|
{
|
|||
|
|
public string AppUserModelId { get; }
|
|||
|
|
|
|||
|
|
public Version Version { get; }
|
|||
|
|
|
|||
|
|
public string DisplayName { get; }
|
|||
|
|
|
|||
|
|
public string SettingsPath { get; }
|
|||
|
|
|
|||
|
|
public string LogoPath { get; }
|
|||
|
|
|
|||
|
|
public TerminalPackage(string appUserModelId, Version version, string displayName, string settingsPath, string logoPath)
|
|||
|
|
{
|
|||
|
|
AppUserModelId = appUserModelId;
|
|||
|
|
Version = version;
|
|||
|
|
DisplayName = displayName;
|
|||
|
|
SettingsPath = settingsPath;
|
|||
|
|
LogoPath = logoPath;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public BitmapImage GetLogo()
|
|||
|
|
{
|
|||
|
|
var image = new BitmapImage();
|
|||
|
|
|
|||
|
|
if (File.Exists(LogoPath))
|
|||
|
|
{
|
|||
|
|
using var fileStream = File.OpenRead(LogoPath);
|
|||
|
|
image.SetSource(fileStream.AsRandomAccessStream());
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
// Not using wox anymore, TODO: find the right new way to handle this
|
|||
|
|
// image.UriSource = new Uri(ImageLoader.ErrorIconPath);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return image;
|
|||
|
|
}
|
|||
|
|
}
|