本文整理汇总了C#中IQueryContext.AskPossibleProperties方法的典型用法代码示例。如果您正苦于以下问题:C# IQueryContext.AskPossibleProperties方法的具体用法?C# IQueryContext.AskPossibleProperties怎么用?C# IQueryContext.AskPossibleProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IQueryContext
的用法示例。
在下文中一共展示了IQueryContext.AskPossibleProperties方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CountPropertyCalculator_new
private static IEnumerable<DynamicPropertyResult> CountPropertyCalculator_new(IQueryContext context, Name x)
{
var set = context.AskPossibleProperties(x).ToList();
Name count = Name.BuildName(set.Count);
IEnumerable<SubstitutionSet> sets;
if (set.Count == 0)
sets = context.Constraints;
else
sets = set.SelectMany(s => s.Item2).Distinct();
foreach (var d in sets)
yield return new DynamicPropertyResult(count, d);
}
示例2: Test_Concat_Dynamic_Property
private static IEnumerable<DynamicPropertyResult> Test_Concat_Dynamic_Property(IQueryContext context, Name x, Name y)
{
foreach (var v1 in context.AskPossibleProperties(x))
{
foreach (var v2 in context.AskPossibleProperties(y))
{
var c2 = Name.BuildName((Name)"Con", v1.Item1, v2.Item1);
foreach (var s in v2.Item2)
{
yield return new DynamicPropertyResult(c2, s);
}
}
}
}
示例3: EventAgePropertyCalculator
private IEnumerable<DynamicPropertyResult> EventAgePropertyCalculator(IQueryContext context, Name id)
{
if(!context.Perspective.Match(Name.SELF_SYMBOL))
yield break;
if (id.IsVariable)
{
foreach (var record in m_registry.Values)
{
var idSub = new Substitution(id, Name.BuildName(record.Id));
foreach (var c in context.Constraints)
{
if (c.Conflicts(idSub))
continue;
var newSet = new SubstitutionSet(c);
newSet.AddSubstitution(idSub);
var value = Tick - record.Timestamp;
yield return new DynamicPropertyResult(Name.BuildName(value), newSet);
}
}
yield break;
}
foreach (var pair in context.AskPossibleProperties(id))
{
uint idValue;
if(!pair.Item1.TryConvertToValue(out idValue))
continue;
var record = m_registry[idValue];
var value = (Tick - record.Timestamp);
foreach (var c in pair.Item2)
yield return new DynamicPropertyResult(Name.BuildName(value), c);
}
}