本文整理汇总了C#中JsArray.pop方法的典型用法代码示例。如果您正苦于以下问题:C# JsArray.pop方法的具体用法?C# JsArray.pop怎么用?C# JsArray.pop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsArray
的用法示例。
在下文中一共展示了JsArray.pop方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: removeFromArray
public void removeFromArray(JsArray items, JsObject obj)
{
JsArray tmpArray = new JsArray();
foreach (JsObject tmp in items)
{
if (tmp != obj)
{
tmpArray.push(tmp);
}
}
while (items.length > 0)
{
items.pop();
}
foreach (object tmp in tmpArray)
{
items.push(tmp);
}
}
示例2: _moveBallInternal
public void _moveBallInternal(ball b, JsArray<point> points, JsAction callback)
{
itemBase self = this;
point point = points.pop();
if (point != null)
{
b.getDiv().style.left = point.x + "%";
b.getDiv().style.top = point.y + "%";
if (point.inSide != ESlide.none)
{
b.setInSide(point.inSide);
}
HtmlContext.window.setTimeout(delegate { self._moveBallInternal(b, points, callback); }, 50);
}
else
{
callback();
}
}
示例3: findChildNodesForSelector
private JsArray<HtmlElement> findChildNodesForSelector(JsArray<HtmlElement> elements, JsArray<JsString> selectorArray)
{
var selector = selectorArray.shift();
//We need to actually abstract this so we can deal with IE and Opera returning a collection instead of a NodeList
var newElements = new JsArray<HtmlElement>();
if ( selector.substr( 0, 1 ) == "." ) {
var className = selector.substring( 1 );
//Lets assume this is a class selector
while ( elements.length > 0 ) {
var element = elements.pop();
var nodes = element.getElementsByClassName( className );
for ( var j=0; j<nodes.length; j++) {
newElements.push( nodes[ j ].As<HtmlElement>() );
}
}
} else {
//invalid but going to assume type for now
while (elements.length > 0) {
var element = elements.pop();
var nodes = element.getElementsByTagName(selector);
for (var j = 0; j < nodes.length; j++) {
newElements.push( nodes[j].As<HtmlElement>() );
}
}
}
//Only recurse if there is another selector
if (selectorArray.length > 0) {
newElements = findChildNodesForSelector(newElements, selectorArray);
}
return newElements;
}