本文整理汇总了C#中ListValue.GetSuffix方法的典型用法代码示例。如果您正苦于以下问题:C# ListValue.GetSuffix方法的具体用法?C# ListValue.GetSuffix怎么用?C# ListValue.GetSuffix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListValue
的用法示例。
在下文中一共展示了ListValue.GetSuffix方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EachListConstructor
public void EachListConstructor()
{
var baseList = new ListValue();
var baseDelegate = ((NoArgsSuffix<int>.Del<int>)baseList.GetSuffix("LENGTH"));
Assert.AreEqual(0, baseDelegate.Invoke());
var castList = ListValue.CreateList(new List<object>());
var castDelegate = ((NoArgsSuffix<int>.Del<int>)castList.GetSuffix("LENGTH"));
Assert.AreEqual(0, castDelegate.Invoke());
var copyDelegate = (NoArgsSuffix<ListValue>.Del<ListValue>)baseList.GetSuffix("COPY");
var copyList = copyDelegate.Invoke();
Assert.AreEqual(0, ((NoArgsSuffix<int>.Del<int>)copyList.GetSuffix("LENGTH")).Invoke());
}
示例2: EachListConstructor
public void EachListConstructor()
{
var cpu = new FakeCpu();
cpu.PushStack(new KOSArgMarkerType());
var baseList = new ListValue();
var baseDelegate = baseList.GetSuffix("LENGTH");
cpu.PushStack(null); // dummy push to be popped by ReverseStackArgs
cpu.PushStack(new KOSArgMarkerType());
baseDelegate.Invoke(cpu);
Assert.AreEqual(ScalarIntValue.Zero, baseDelegate.Value);
var castList = ListValue.CreateList(new List<object>());
var castDelegate = castList.GetSuffix("LENGTH");
cpu.PushStack(null); // dummy push to be popped by ReverseStackArgs
cpu.PushStack(new KOSArgMarkerType());
castDelegate.Invoke(cpu);
Assert.AreEqual(ScalarIntValue.Zero, castDelegate.Value);
var copyDelegate = baseList.GetSuffix("COPY");
cpu.PushStack(null); // dummy push to be popped by ReverseStackArgs
cpu.PushStack(new KOSArgMarkerType());
copyDelegate.Invoke(cpu);
var copyList = copyDelegate.Value;
Assert.AreEqual(baseList, copyList);
var lengthDelegate = copyList.GetSuffix("LENGTH");
cpu.PushStack(null); // dummy push to be popped by ReverseStackArgs
cpu.PushStack(new KOSArgMarkerType());
lengthDelegate.Invoke(cpu);
Assert.AreEqual(ScalarIntValue.Zero, lengthDelegate.Value);
}
示例3: InvokeDelegate
private object InvokeDelegate(ListValue list, string suffixName, params object[] parameters)
{
var lengthObj = list.GetSuffix(suffixName);
Assert.IsNotNull(lengthObj);
var lengthDelegate = lengthObj as Delegate;
Assert.IsNotNull(lengthDelegate);
var length = lengthDelegate.DynamicInvoke(parameters);
return length;
}