本文整理汇总了C#中JArray.RemoveAt方法的典型用法代码示例。如果您正苦于以下问题:C# JArray.RemoveAt方法的具体用法?C# JArray.RemoveAt怎么用?C# JArray.RemoveAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JArray
的用法示例。
在下文中一共展示了JArray.RemoveAt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveAtNegativeIndexShouldError
public void RemoveAtNegativeIndexShouldError()
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentOutOfRangeException>(
@"Index is less than 0.
Parameter name: index",
() =>
{
j.RemoveAt(-1);
});
}
示例2: RemoveAtOutOfRangeIndexShouldError
public void RemoveAtOutOfRangeIndexShouldError()
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentOutOfRangeException>(
@"Index is equal to or greater than Count.
Parameter name: index",
() =>
{
j.RemoveAt(0);
});
}
示例3: RemoveAtNegativeIndexShouldError
public void RemoveAtNegativeIndexShouldError()
{
JArray j = new JArray();
j.RemoveAt(-1);
}
示例4: RemoveAt
public void RemoveAt()
{
JValue v1 = new JValue(1);
JValue v2 = new JValue(1);
JValue v3 = new JValue(1);
JArray j = new JArray();
j.Add(v1);
j.Add(v2);
j.Add(v3);
Assert.AreEqual(true, j.Contains(v1));
j.RemoveAt(0);
Assert.AreEqual(false, j.Contains(v1));
Assert.AreEqual(true, j.Contains(v3));
j.RemoveAt(1);
Assert.AreEqual(false, j.Contains(v3));
Assert.AreEqual(1, j.Count);
}
示例5: RemoveAtOutOfRangeIndexShouldError
public void RemoveAtOutOfRangeIndexShouldError()
{
JArray j = new JArray();
j.RemoveAt(0);
}