public virtual cape.File next() { while (true) { if (!(stack != null)) { if (!(root != null)) { break; } var es = root.entries(); root = null; if (!(es != null)) { break; } stack = new cape.Stack <cape.Iterator <cape.File> >(); stack.push((cape.Iterator <cape.File>)es); } var entries = stack.peek(); if (!(entries != null)) { stack = null; break; } var e = entries.next(); if (!(e != null)) { stack.pop(); } else if (matchExcludePattern(e)) { ; } else if (e.isFile()) { if (matchPattern(e)) { return(e); } } else if (includeMatchingDirectories && e.isDirectory() && matchPattern(e)) { return(e); } else if (e.isDirectory() && e.isLink() == false) { var ees = e.entries(); if (ees != null) { stack.push((cape.Iterator <cape.File>)ees); } if (includeDirectories) { return(e); } } } return(null); }
public static cape.DynamicMap parseAsTreeObject(string xml, bool ignoreWhiteSpace = true) { cape.DynamicMap root = null; var stack = new cape.Stack <cape.DynamicMap>(); var pp = capex.text.XMLParser.forString(xml); pp.setIgnoreWhiteSpace(ignoreWhiteSpace); while (true) { var o = pp.next(); if (o == null) { break; } if (o is capex.text.XMLParser.StartElement) { var name = ((capex.text.XMLParser.StartElement)o).getName(); if (root == null && object.Equals(name, "?xml")) { continue; } var nn = new cape.DynamicMap(); nn.set("name", (object)name); nn.set("attributes", (object)((capex.text.XMLParser.StartElement)o).getParams()); if (root == null) { root = nn; stack.push((cape.DynamicMap)nn); } else { var current = stack.peek(); if (current == null) { current = root; } var children = current.getDynamicVector("children"); if (children == null) { children = new cape.DynamicVector(); current.set("children", (object)children); } children.append((object)nn); stack.push((cape.DynamicMap)nn); } } else if (o is capex.text.XMLParser.EndElement) { stack.pop(); } else if (o is capex.text.XMLParser.CharacterData) { var current1 = stack.peek(); if (current1 != null) { var children1 = current1.getDynamicVector("children"); if (children1 == null) { children1 = new cape.DynamicVector(); current1.set("children", (object)children1); } children1.append((object)((capex.text.XMLParser.CharacterData)o).getData()); } } } return(root); }
public NavigationWidget(cave.GuiApplicationContext ctx) : base(ctx) { widgetStack = new cape.Stack <Windows.UI.Xaml.UIElement>(); widgetActionBarBackgroundColor = cave.Color.black(); widgetActionBarTextColor = cave.Color.white(); }
public SceneManager() { sceneStack = new cape.Stack <motion.Scene>(); }
public void clear() { stack = new cape.Stack <cave.ui.FormDeclaration.Element>(); root = startVerticalContainer(); }
public cape.FileFinder setRoot(cape.File root) { this.root = root; stack = null; return(this); }