本文整理汇总了C#中IPersistentMap.seq方法的典型用法代码示例。如果您正苦于以下问题:C# IPersistentMap.seq方法的具体用法?C# IPersistentMap.seq怎么用?C# IPersistentMap.seq使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPersistentMap
的用法示例。
在下文中一共展示了IPersistentMap.seq方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MapEnumerator
/// <summary>
/// Construct a <see cref="MapEnumerator">MapEnumerator</see> from a persistent map.
/// </summary>
/// <param name="map">The map to iterate over.</param>
public MapEnumerator(IPersistentMap map)
{
_seqEnum = new SeqEnumerator(map.seq());
}
示例2: EmitExposers
private static void EmitExposers(TypeBuilder proxyTB, Type superClass, IPersistentMap exposesFields)
{
for ( ISeq s = exposesFields.seq(); s != null; s = s.next() )
{
IMapEntry me = (IMapEntry)s.first();
Symbol protectedFieldSym = (Symbol)me.key();
IPersistentMap accessMap = (IPersistentMap)me.val();
string fieldName = protectedFieldSym.Name;
Symbol getterSym = (Symbol)accessMap.valAt(_getKw, null);
Symbol setterSym = (Symbol)accessMap.valAt(_setKW, null);
FieldInfo fld = null;
if ( getterSym != null || setterSym != null )
fld = superClass.GetField(fieldName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy | BindingFlags.Static | BindingFlags.Instance);
if (getterSym != null)
{
MethodAttributes attribs = MethodAttributes.Public;
if (fld.IsStatic)
attribs |= MethodAttributes.Static;
MethodBuilder mb = proxyTB.DefineMethod(getterSym.Name, attribs, fld.FieldType, Type.EmptyTypes);
ILGenerator gen = mb.GetILGenerator();
if (fld.IsStatic)
gen.Emit(OpCodes.Ldsfld, fld);
else
{
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(OpCodes.Ldfld, fld);
}
gen.Emit(OpCodes.Ret);
}
if (setterSym != null)
{
MethodAttributes attribs = MethodAttributes.Public;
if (fld.IsStatic)
attribs |= MethodAttributes.Static;
MethodBuilder mb = proxyTB.DefineMethod(setterSym.Name, attribs, typeof(void), new Type[] { fld.FieldType });
ILGenerator gen = mb.GetILGenerator();
if (fld.IsStatic)
{
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(OpCodes.Stsfld, fld);
}
else
{
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(OpCodes.Ldarg_1);
gen.Emit(OpCodes.Stfld, fld);
}
gen.Emit(OpCodes.Ret);
}
}
}