本文整理汇总了C#中IGraphProcessingEnvironment.RewritingNextMatch方法的典型用法代码示例。如果您正苦于以下问题:C# IGraphProcessingEnvironment.RewritingNextMatch方法的具体用法?C# IGraphProcessingEnvironment.RewritingNextMatch怎么用?C# IGraphProcessingEnvironment.RewritingNextMatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGraphProcessingEnvironment
的用法示例。
在下文中一共展示了IGraphProcessingEnvironment.RewritingNextMatch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Rewrite
public override bool Rewrite(IGraphProcessingEnvironment procEnv, IMatches matches, IMatch chosenMatch)
{
CountResult.SetVariableValue(matches.Count, procEnv);
if(matches.Count == 0) return false;
if(Test) return false;
procEnv.Finishing(matches, Special);
#if DEBUGACTIONS || MATCHREWRITEDETAIL
procEnv.PerformanceInfo.StartLocal();
#endif
object[] retElems = null;
IEnumerator<IMatch> matchesEnum = matches.GetEnumerator();
while(matchesEnum.MoveNext())
{
IMatch match = matchesEnum.Current;
if(match != matches.First) procEnv.RewritingNextMatch();
retElems = matches.Producer.Modify(procEnv, match);
procEnv.PerformanceInfo.RewritesPerformed++;
}
if(retElems == null) retElems = NoElems;
for(int i = 0; i < ParamBindings.ReturnVars.Length; i++)
ParamBindings.ReturnVars[i].SetVariableValue(retElems[i], procEnv);
#if DEBUGACTIONS || MATCHREWRITEDETAIL
procEnv.PerformanceInfo.StopRewrite(); // total rewrite time does NOT include listeners anymore
#endif
procEnv.Finished(matches, Special);
#if LOG_SEQUENCE_EXECUTION
procEnv.Recorder.WriteLine("Matched/Applied " + Symbol);
procEnv.Recorder.Flush();
#endif
return true;
}