mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
32 lines
718 B
C#
32 lines
718 B
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.
|
|||
|
|
|
|||
|
|
namespace Microsoft.CommandPalette.Extensions.Toolkit;
|
|||
|
|
|
|||
|
|
public partial class DetailsLink : IDetailsLink
|
|||
|
|
{
|
|||
|
|
public virtual Uri? Link { get; set; }
|
|||
|
|
|
|||
|
|
public virtual string Text { get; set; } = string.Empty;
|
|||
|
|
|
|||
|
|
public DetailsLink()
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public DetailsLink(string url)
|
|||
|
|
: this(url, url)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public DetailsLink(string url, string text)
|
|||
|
|
{
|
|||
|
|
if (Uri.TryCreate(url, default(UriCreationOptions), out var newUri))
|
|||
|
|
{
|
|||
|
|
Link = newUri;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Text = text;
|
|||
|
|
}
|
|||
|
|
}
|