本文整理汇总了C#中AType.AddWithNoUpdate方法的典型用法代码示例。如果您正苦于以下问题:C# AType.AddWithNoUpdate方法的具体用法?C# AType.AddWithNoUpdate怎么用?C# AType.AddWithNoUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AType
的用法示例。
在下文中一共展示了AType.AddWithNoUpdate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExtractItems
/// <summary>
/// ExtractItems from the <see cref="argument"/> and add it to the <see cref="result"/> vector.
/// </summary>
/// <param name="argument"></param>
/// <param name="result">The array stores the result vector</param>
private void ExtractItems(AType argument, AType result)
{
if (argument.IsArray)
{
foreach (AType item in argument)
{
ExtractItems(item, result);
}
}
else
{
result.AddWithNoUpdate(argument);
}
}
示例2: Catenate
/// <summary>
/// Catenate items to the result.
/// </summary>
/// <param name="items"></param>
/// <param name="result"></param>
/// <returns>Number of items added to the result.</returns>
private static int Catenate(AType items, AType result)
{
for (int i = 0; i < items.Length; i++)
{
result.AddWithNoUpdate(items[i].Clone());
}
return items.Length;
}
示例3: DiscloseNestedElement
/// <summary>
/// The result is a nested vector whose depth is one.
/// </summary>
/// <param name="argument"></param>
/// <param name="result"></param>
/// <returns>Number of items disclosed.</returns>
private int DiscloseNestedElement(AType argument, AType result)
{
int count = 0;
if (argument.IsArray)
{
// if rank of the argument is higher than one, so not vector, we ravel it
AType raveled = (argument.Rank > 1 ? MonadicFunctionInstance.Ravel.Execute(argument) : argument);
// call this function recursively for each element in the array.
foreach (AType item in raveled)
{
count += DiscloseNestedElement(item, result);
}
}
else
{
// get the depth of the argument
int depth = MonadicFunctionInstance.Depth.Execute(argument).asInteger;
// if depth is bigger than 1, we disclose it
if (depth > 1)
{
count += DiscloseNestedElement(MonadicFunctionInstance.Disclose.Execute(argument), result);
}
else
{
bool isBox = argument.IsBox;
// leave out Null item
if((isBox && argument.NestedItem.Type != ATypes.ANull) || !isBox)
{
result.AddWithNoUpdate(argument);
count++;
}
}
}
return count;
}