本文整理汇总了C#中QueryToken.GetPropertyRoute方法的典型用法代码示例。如果您正苦于以下问题:C# QueryToken.GetPropertyRoute方法的具体用法?C# QueryToken.GetPropertyRoute怎么用?C# QueryToken.GetPropertyRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryToken
的用法示例。
在下文中一共展示了QueryToken.GetPropertyRoute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsDateOnly
public static bool IsDateOnly(QueryToken token)
{
if (token is MonthStartToken || token is DateToken)
return true;
PropertyRoute route = token.GetPropertyRoute();
if (route != null && route.PropertyRouteType == PropertyRouteType.FieldOrProperty)
{
var pp = Validator.TryGetPropertyValidator(route);
if (pp != null)
{
DateTimePrecissionValidatorAttribute datetimePrecission = pp.Validators.OfType<DateTimePrecissionValidatorAttribute>().SingleOrDefaultEx();
if (datetimePrecission != null && datetimePrecission.Precision == DateTimePrecision.Days)
return true;
}
}
return false;
}
示例2: FromToken
internal static MetaExpression FromToken(QueryToken token, Type sourceType)
{
var pr = token.GetPropertyRoute();
if (pr == null)
return new MetaExpression(sourceType, new DirtyMeta(token.GetImplementations(), new Meta[0]));
if (!sourceType.IsLite() && pr.Type.IsLite())
return new MetaExpression(sourceType, new CleanMeta(token.GetImplementations(), new[] { pr.Add("Entity") }));
return new MetaExpression(sourceType, new CleanMeta(token.GetImplementations(), new[] { pr }));
//throw new InvalidOperationException("Impossible to convert {0} to {1}".FormatWith(pr.Type.TypeName(), sourceType.TypeName()));
}
示例3: QueryTokenTS
public QueryTokenTS(QueryToken qt, bool recursive)
{
this.toString = qt.ToString();
this.niceName = qt.NiceName();
this.key = qt.Key;
this.fullKey = qt.FullKey();
this.type = new TypeReferenceTS(qt.Type, qt.GetImplementations());
this.filterType = QueryUtils.TryGetFilterType(qt.Type);
this.format = qt.Format;
this.unit = qt.Unit;
this.typeColor = qt.TypeColor;
this.niceTypeName = qt.NiceTypeName;
this.queryTokenType = GetQueryTokenType(qt);
this.isGroupable = qt.IsGroupable;
this.propertyRoute = qt.GetPropertyRoute()?.ToString();
if (recursive && qt.Parent != null)
this.parent = new QueryTokenTS(qt.Parent, recursive);
}