示例#1
0
 protected void EvaluateCurrentTokens(EvaluateFor <TPart> evaluate)
 {
     evaluate
     .Token("Current", part => part)
     .Token(
         token => token.StartsWith("Current:", StringComparison.OrdinalIgnoreCase) ? token.Substring("Current:".Length) : null,
         (token, part) => part == null ? null : part.Retrieve <string>(token)
         );
 }
示例#2
0
        protected void EvaluateAutoTokens(EvaluateFor <TPart> evaluate)
        {
            evaluate
            .Token((token, defaultData) => {
                var tokenParts = _tokenEncoder.Decode(token);
                if (tokenParts == null)
                {
                    return(null);
                }

                var part = GetByTitle(tokenParts.Prefix);
                if (part == null)
                {
                    return(null);
                }

                return(part.Retrieve <string>(tokenParts.SubToken));
            });
        }