Example #1
0
        /* static */
        /// <summary>
        /// Creates and returns an instance of this class
        /// </summary>
        static internal FuncParam CreateParam(DocItem Parent, string Name)
        {
            FuncParam Result = new FuncParam();

            //Result.Parent = Parent;
            Result.Name        = Name;
            Result.Type        = "Any";
            Result.Description = "";

            return(Result);
        }
Example #2
0
        void ParseAfter_ParamNames()
        {
            if (this.Params == null)
            {
                int    Counter = 0;
                string Line;
                int    Index2, Index;
                for (int i = this.DocLet.LastLineIndex + 1; Counter < 3 && i < this.DocLet.Lines.Length; i++)
                {
                    Counter++;

                    Line = this.DocLet.Lines[i].Trim();
                    if (!string.IsNullOrWhiteSpace(Line))
                    {
                        Index = Line.IndexOf('(');
                        if (Index != -1)
                        {
                            Index2 = Line.IndexOf(')', Index + 1);
                            if (Index2 != -1)
                            {
                                string S = Line.Substring(Index + 1, Index2 - (Index + 1));
                                if (!string.IsNullOrWhiteSpace(S))
                                {
                                    string[] Parts = S.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                                    if (Parts.Length > 0)
                                    {
                                        FuncParam Param;
                                        this.Params = new List <FuncParam>();
                                        foreach (var ParamName in Parts)
                                        {
                                            S     = ParamName.Trim();
                                            Param = FuncParam.CreateParam(this, S);
                                            this.Params.Add(Param);
                                        }
                                    }
                                }
                            }

                            return;
                        }
                    }
                }
            }
        }
Example #3
0
        List <FuncParam> GetParams()
        {
            List <FuncParam> Result = null;
            //@param {String|Element} Selector - A selector or an element

            List <Block> List = DocLet.Blocks.Where(item => item.TagName == Tags.Param).ToList();

            if (List != null && List.Count > 0)
            {
                FuncParam Item;
                Result = new List <FuncParam>();
                foreach (Block B in List)
                {
                    string BlockText = GetMultiLineBlockValue(B);
                    if (!string.IsNullOrWhiteSpace(BlockText))
                    {
                        Item = new FuncParam(this, BlockText);
                        Result.Add(Item);
                    }
                }
            }

            return(Result);
        }