本文整理汇总了C#中IQuerySource.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IQuerySource.ToString方法的具体用法?C# IQuerySource.ToString怎么用?C# IQuerySource.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IQuerySource
的用法示例。
在下文中一共展示了IQuerySource.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetReplacement
/// <summary>
/// Return the value for a query reference
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public Expression GetReplacement(IQuerySource query)
{
if (!_queryReplacement.ContainsKey(query))
return null;
Debug.WriteLine("Cache Lookup QS {0} => {1}", query.ToString(), _queryReplacement[query]);
_QSReferencedSet.Add(query);
return _queryReplacement[query];
}
示例2: AddInternal
/// <summary>
/// Replace or add the variable as requested.
/// </summary>
/// <param name="varName"></param>
/// <param name="replacementExpr"></param>
/// <returns></returns>
public IVariableScopeHolder AddInternal(IQuerySource query, Expression replacementExpr)
{
Debug.WriteLine("Caching QS {0} => {1}", query.ToString(), replacementExpr.ToString());
// If this QS is referenced by a QM cache line, then we need to invalidate that QM.
if (_queryReplacement.ContainsKey(query))
{
var badQM = (from q in _queryModelCache
where q.Value._referencedQS.Contains(query)
select q.Key).ToArray();
Debug.Indent();
foreach (var qm in badQM)
{
Debug.WriteLine("Removing QM due to change in QS {0}{1}", qm.ToString(), "");
_queryModelCache.Remove(qm);
}
Debug.Unindent();
}
///
/// Somethign to get us back to this state
///
IVariableScopeHolder popper = null;
if (_queryReplacement.ContainsKey(query))
{
popper = new CCReplacementQuery(this, query, _queryReplacement[query]);
}
else
{
popper = new CCReplacementQuery(this, query, null);
}
///
/// And save the expression for future lookup
///
if (replacementExpr != null)
{
_queryReplacement[query] = replacementExpr;
}
else
{
_queryReplacement.Remove(query);
}
return popper;
}