当前位置: 首页>>代码示例>>C#>>正文


C# ListValue.GetSuffix方法代码示例

本文整理汇总了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());
        }
开发者ID:Whitecaribou,项目名称:KOS,代码行数:15,代码来源:ListValueTest.cs

示例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);
        }
开发者ID:CalebJ2,项目名称:KOS,代码行数:32,代码来源:ListValueTest.cs

示例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;
 }
开发者ID:space-is-hard,项目名称:KOS,代码行数:9,代码来源:ListValueTest.cs


注:本文中的ListValue.GetSuffix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。