Exemplo n.º 1
0
        static void OnHelpLinkClicked(
            HelpPanel helpPanel,
            HelpLink helpLink)
        {
            HelpLink.LinkType linkType;
            string            content;

            if (!HelpLinkData.TryGet(helpLink.Link, out linkType, out content))
            {
                return;
            }

            switch (linkType)
            {
            case HelpLink.LinkType.Action:
                GuiMessage.ShowInformation(
                    "An ACTION link has been clicked:\n" + content);
                break;

            case HelpLink.LinkType.Help:
                helpPanel.Show(
                    content == "sample1" ?
                    Images.Name.GenericBuho1 :
                    Images.Name.GenericBuhoShe1,
                    content == "sample1" ?
                    TestingHelpData.GetSample1() :
                    TestingHelpData.GetSample2());
                break;

            case HelpLink.LinkType.Link:
                Process.Start(content);
                break;
            }
        }
Exemplo n.º 2
0
 internal static Data BuildForLink(HelpLink link)
 {
     return(new Data()
     {
         Begin = link.Position,
         Length = link.Length,
         Prefix = LINK_PREFIX,
         Suffix = LINK_SUFFIX
     });
 }
Exemplo n.º 3
0
        static Segment.Data GetSegmentData(object segment)
        {
            if (segment is HelpLink)
            {
                HelpLink link = (HelpLink)segment;
                return(Segment.BuildForLink(link));
            }

            HelpFormat format = (HelpFormat)segment;

            return(Segment.BuildForFormat(format));
        }
Exemplo n.º 4
0
        internal bool TryGetLinkAtChar(
            int charIndex,
            out HelpLink link)
        {
            link = null;

            FormattedHelpLink formattedLink = GetFormattedLinkAtChar(
                mFormattedLinks, charIndex);

            if (formattedLink == null)
            {
                return(false);
            }

            link = formattedLink.Source;

            return(!BuildFormattedHelp.IsLinkMetaChar(formattedLink, charIndex));
        }