public static DescribeFor TokenFor <T>(this DescribeFor self, Expression <Func <T, object> > expression, LocalizedString name, LocalizedString description, string chainTarget = null) { #pragma warning disable CS0618 // We need enum support here var property = ObjectExtensions.PropertyName(expression); #pragma warning restore CS0618 // Type or member is obsolete return(self.Token(property, name, description, chainTarget)); }
protected void DescribeCurrentTokens(DescribeFor describe) { string name = typeof(TPart).Name; describe .Token("Current", T("Current"), T("The current {0}", name)) .Token("Current:*", T("Current:<value>"), T("The value (as String) from the current {0}'s InfoSet", name), "Current") ; }
protected void DescribeAutoTokens(DescribeFor describe) { foreach (var part in _contentManager.Query <TPart>().List()) { var titlePart = part.As <ITitleAspect>(); if (titlePart == null) { continue; } var encodingContext = _tokenEncoder.Encode("*", titlePart.Title); describe.Token( encodingContext.Token, T(encodingContext.Token.Replace("*", "<value>")), T("A value (as String) from the {0} {1}'s InfoSet", titlePart.Title, typeof(TPart).Name) ); } }