This is the entry for one object in the documentation.
Ejemplo n.º 1
0
        void PrintSection(HelpSection section)
        {
            if (section != null)
            {
                formatter.AddSection(section.Name, section.Topic);
                formatter.AddDescription(section.Description);

                if (section.HasLink)
                {
                    formatter.AddLink(section.Link);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the HelpSection that belongs to the name of the given entry.
        /// </summary>
        /// <param name="entry">The name of the entry to retrieve.</param>
        /// <returns>The HelpSection instance.</returns>
        public HelpSection Get(string entry)
        {
            var topic = topics.SelectMany(m => m.Where(n => n.Name.Equals(entry, StringComparison.CurrentCultureIgnoreCase)).Select(n => n)).FirstOrDefault();
            var to    = topic.Instance.GetType();

            if (topic.Instance is IFunction)
            {
                var help = new HelpFunctionSection();
                help.Name        = topic.Name;
                help.Description = GetDescription(to);
                help.Topic       = topic.Topic.Kind;
                help.Link        = GetLink(to);
                var functions = to.GetMethods();

                foreach (var function in functions)
                {
                    if (function.Name.Equals("Function"))
                    {
                        var isextern   = true;
                        var parameters = function.GetParameters();

                        foreach (var parameter in parameters)
                        {
                            if (!parameter.ParameterType.IsSubclassOf(typeof(Value)))
                            {
                                isextern = false;
                                break;
                            }
                        }

                        if (isextern)
                        {
                            help.Usages.Add(GetUsage(help.Name, function));
                        }
                    }
                }

                return(help);
            }
            else
            {
                var help = new HelpSection();
                help.Name        = topic.Name;
                help.Description = GetDescription(to);
                help.Topic       = topic.Topic.Kind;
                help.Link        = GetLink(to);
                return(help);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the HelpSection that belongs to the name of the given entry.
        /// </summary>
        /// <param name="entry">The name of the entry to retrieve.</param>
        /// <returns>The HelpSection instance.</returns>
        public HelpSection Get(String entry)
        {
            var topic = topics.SelectMany(m => m.Where(n => n.Name.Equals(entry, StringComparison.CurrentCultureIgnoreCase)).Select(n => n)).FirstOrDefault();
            var to = topic.Instance.GetType();

            if (topic.Instance is IFunction)
            {
                var help = new HelpFunctionSection();
                help.Name = topic.Name;
                help.Description = GetDescription(to);
                help.Topic = topic.Topic.Kind;
                help.Link = GetLink(to);
                var functions = to.GetMethods();

                foreach (var function in functions)
                {
                    if (function.Name.Equals("Function"))
                    {
                        var isextern = true;
                        var parameters = function.GetParameters();

                        foreach (var parameter in parameters)
                        {
                            if (!parameter.ParameterType.IsSubclassOf(typeof(Value)))
                            {
                                isextern = false;
                                break;
                            }
                        }

                        if (isextern)
                        {
                            help.Usages.Add(GetUsage(help.Name, function));
                        }
                    }
                }

                return help;
            }
            else
            {
                var help = new HelpSection();
                help.Name = topic.Name;
                help.Description = GetDescription(to);
                help.Topic = topic.Topic.Kind;
                help.Link = GetLink(to);
                return help;
            }
        }