Firstborn/Library/PackageCache/com.unity.collab-proxy@1.17.7/Editor/PlasticSCM/Help/HelpLinkData.cs
Schaken-Mods b486678290 Library -Artifacts
Library -Artifacts
2023-03-28 12:24:16 -05:00

43 lines
1.1 KiB
C#

using System;
using Codice.LogWrapper;
namespace Unity.PlasticSCM.Editor.Help
{
internal static class HelpLinkData
{
internal static bool TryGet(
string link, out HelpLink.LinkType type, out string content)
{
type = HelpLink.LinkType.Link;
content = string.Empty;
int separatorIdx = link.IndexOf(':');
if (separatorIdx == -1)
return false;
string key = link.Substring(0, separatorIdx);
try
{
type = (HelpLink.LinkType)Enum.Parse(
typeof(HelpLink.LinkType), key, true);
}
catch (Exception ex)
{
mLog.ErrorFormat("Unable to get help link data: '{0}': {1}",
key, ex.Message);
mLog.DebugFormat("StackTrace: {0}", ex.StackTrace);
return false;
}
content = link.Substring(separatorIdx + 1);
return true;
}
static readonly ILog mLog = LogManager.GetLogger("HelpLinkData");
}
}