コード例 #1
0
        public bool Generate()
        {
            GUILayout.Label(ErrorLabelContent, _errorLabelStyle.Get);

            var helpClicked = GenerateHelpButton();

            if (helpClicked && Event.current.button == 0)
            {
                Application.OpenURL(HelpUri.ToString());
            }

            return(helpClicked);
        }
コード例 #2
0
        protected override string FormatUri(HelpTopic source, HelpUri uri)
        {
            switch (uri.Type)
            {
            case HelpUriType.Context:
            case HelpUriType.GlobalContext:
            case HelpUriType.LocalContext:
            {
                HelpTopic target = system.ResolveUri(source.Database, uri);
                if (target != null)
                {
                    if (target.Database == source.Database)
                    {
                        return(string.Format("T{0:X4}.html", target.TopicIndex));
                    }
                    else
                    {
                        return(string.Format("../{0}/T{1:X4}.html",
                                             GetDatabasePath(target.Database),
                                             target.TopicIndex));
                    }
                }
                else
                {
                    Console.WriteLine("Warning: cannot resolve context string '{0}'", uri);
                }
            }
            break;

            case HelpUriType.LocalTopic:
                return(string.Format("T{0:X4}.html", uri.TopicIndex));

            case HelpUriType.Command:
            case HelpUriType.File:
            default:
                // TODO: would be better if we have the source location.
                Console.WriteLine("Warning: cannot convert link: {0}", uri);
                break;
            }
            return("?" + uri.ToString());
        }
コード例 #3
0
 protected override string FormatUri(HelpTopic topic, HelpUri uri)
 {
     return("?" + Escape(uri.ToString()));
 }