本文整理汇总了C#中IStore.Enter方法的典型用法代码示例。如果您正苦于以下问题:C# IStore.Enter方法的具体用法?C# IStore.Enter怎么用?C# IStore.Enter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStore
的用法示例。
在下文中一共展示了IStore.Enter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
public bool Render(IStore store, TextWriter output, out Value result)
{
bool halt;
foreach (KeyValuePair<IEvaluator, INode> branch in this.branches)
{
if (branch.Key.Evaluate (store, output).AsBoolean)
{
store.Enter ();
halt = branch.Value.Render (store, output, out result);
store.Leave ();
return halt;
}
}
if (this.fallback != null)
{
store.Enter ();
halt = this.fallback.Render (store, output, out result);
store.Leave ();
return halt;
}
result = VoidValue.Instance;
return false;
}
示例2: Render
public bool Render(IStore store, TextWriter output, out Value result)
{
IMap fields;
fields = this.from.Evaluate (store, output).Fields;
if (fields.Count > 0)
{
foreach (KeyValuePair<Value, Value> pair in fields)
{
store.Enter ();
if (!string.IsNullOrEmpty (this.key))
store.Set (this.key, pair.Key, StoreMode.Local);
store.Set (this.value, pair.Value, StoreMode.Local);
if (this.body.Render (store, output, out result))
{
store.Leave ();
return true;
}
store.Leave ();
}
}
else if (this.empty != null)
{
store.Enter ();
if (this.empty.Render (store, output, out result))
{
store.Leave ();
return true;
}
store.Leave ();
}
result = VoidValue.Instance;
return false;
}