本文整理匯總了C#中System.Dynamic.ExpandoObject.StartsWith方法的典型用法代碼示例。如果您正苦於以下問題:C# ExpandoObject.StartsWith方法的具體用法?C# ExpandoObject.StartsWith怎麽用?C# ExpandoObject.StartsWith使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Dynamic.ExpandoObject
的用法示例。
在下文中一共展示了ExpandoObject.StartsWith方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: MethodCollisionTest
public void MethodCollisionTest()
{
dynamic tNew = new ExpandoObject();
tNew.StartsWith = new Func<string, bool>(x => true);
ISimpleStringMethod tActsLike = Impromptu.ActLike<ISimpleStringMethod>(tNew, typeof(ISimpleStringMethodCollision));
Assert.AreEqual(tNew.StartsWith("test"), tActsLike.StartsWith("test"));
dynamic tNew2 = new ExpandoObject();
tNew2.StartsWith = new Func<string, int>(x => 5);
ISimpleStringMethodCollision tActsLike2 = Impromptu.ActLike<ISimpleStringMethod>(tNew2, typeof(ISimpleStringMethodCollision));
Assert.AreEqual(tNew2.StartsWith("test"), tActsLike2.StartsWith("test"));
}
示例2: InterfaceDirectDuplicateTest
public void InterfaceDirectDuplicateTest()
{
dynamic tNew = new ExpandoObject();
tNew.StartsWith = new Func<string, bool>(x => true);
ISimpleStringMethod tActsLike = Impromptu.ActLike<ISimpleStringMethod>(tNew, typeof(ISimpleStringMethod));
Assert.AreEqual(tNew.StartsWith("test"), tActsLike.StartsWith("test"));
}