mirror of
https://github.com/nsnail/dot.git
synced 2025-06-17 21:13:21 +08:00
27 lines
618 B
C#
27 lines
618 B
C#
// ReSharper disable ClassNeverInstantiated.Global
|
|
|
|
using System.Globalization;
|
|
#if NET7_0_WINDOWS
|
|
using TextCopy;
|
|
#endif
|
|
|
|
namespace Dot.Guid;
|
|
|
|
[Description(nameof(Str.GuidTool))]
|
|
[Localization(typeof(Str))]
|
|
internal sealed class Main : ToolBase<Option>
|
|
{
|
|
protected override Task Core()
|
|
{
|
|
var guid = System.Guid.NewGuid().ToString();
|
|
if (Opt.Upper) {
|
|
guid = guid.ToUpper(CultureInfo.InvariantCulture);
|
|
}
|
|
|
|
Console.WriteLine(Str.Copied, guid);
|
|
#if NET7_0_WINDOWS
|
|
ClipboardService.SetText(guid);
|
|
#endif
|
|
return Task.CompletedTask;
|
|
}
|
|
} |