Без опису
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using Codice.LogWrapper;
  3. namespace Unity.PlasticSCM.Editor.Help
  4. {
  5. internal static class HelpLinkData
  6. {
  7. internal static bool TryGet(
  8. string link, out HelpLink.LinkType type, out string content)
  9. {
  10. type = HelpLink.LinkType.Link;
  11. content = string.Empty;
  12. int separatorIdx = link.IndexOf(':');
  13. if (separatorIdx == -1)
  14. return false;
  15. string key = link.Substring(0, separatorIdx);
  16. try
  17. {
  18. type = (HelpLink.LinkType)Enum.Parse(
  19. typeof(HelpLink.LinkType), key, true);
  20. }
  21. catch (Exception ex)
  22. {
  23. mLog.ErrorFormat("Unable to get help link data: '{0}': {1}",
  24. key, ex.Message);
  25. mLog.DebugFormat("StackTrace: {0}", ex.StackTrace);
  26. return false;
  27. }
  28. content = link.Substring(separatorIdx + 1);
  29. return true;
  30. }
  31. static readonly ILog mLog = LogManager.GetLogger("HelpLinkData");
  32. }
  33. }