Beispiel #1
0
 public static dfList <dfMarkupToken> Tokenize(string source)
 {
     using (var tokenizer = (pool.Count > 0) ? pool.Pop() : new dfMarkupTokenizer())
     {
         return(tokenizer.tokenize(source));
     }
 }
Beispiel #2
0
    public static dfMarkupTokenAttribute Obtain(dfMarkupToken key, dfMarkupToken value)
    {
        var instance = (pool.Count > 0) ? pool.Pop() : new dfMarkupTokenAttribute();

        instance.Key   = key;
        instance.Value = value;

        return(instance);
    }
Beispiel #3
0
        public static LineRenderInfo Obtain(int start, int end)
        {
            var result = (pool.Count > 0) ? pool.Pop() : new LineRenderInfo();

            result.startOffset = start;
            result.endOffset   = end;
            result.lineHeight  = 0;

            return(result);
        }
Beispiel #4
0
    public static dfMarkupToken Obtain(string source, dfMarkupTokenType type, int startIndex, int endIndex)
    {
        var instance = (pool.Count > 0) ? pool.Pop() : new dfMarkupToken();

        instance.inUse       = true;
        instance.Source      = source;
        instance.TokenType   = type;
        instance.StartOffset = startIndex;
        instance.EndOffset   = Mathf.Min(source.Length - 1, endIndex);

        return(instance);
    }
Beispiel #5
0
 public static FontCharacterRequest Obtain()
 {
     return((pool.Count > 0) ? pool.Pop() : new FontCharacterRequest());
 }