Exemple #1
0
        /// <summary>
        /// Generates a sequence of tokens representing the value
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public IEnumerable <Token <ModelTokenType> > GetTokens(object value)
        {
            ICycleDetector detector;

            switch (this.Settings.GraphCycles)
            {
            case GraphCycleType.MaxDepth:
            {
                detector = new DepthCounter(this.Settings.MaxDepth);
                break;
            }

            default:
            {
                detector = new ReferenceSet();
                break;
            }
            }

            List <Token <ModelTokenType> > tokens = new List <Token <ModelTokenType> >();

            this.GetTokens(tokens, detector, value);
            return(tokens);
        }