public override void endElement(System.String uri, System.String localName, System.String qName) { XLRNode current = null; if (context.Count > 0) { current = (XLRNode)SupportClass.StackSupport.Pop(context); } if ("messages".Equals(qName)) { // done } else if ("text".Equals(qName)) { if (textBuffer.Length > 0) { current.children.Add(new XLRTextNode(textBuffer.ToString())); } } else if ("variable".Equals(qName)) { if (textBuffer.Length > 0) { ((XLRVariableNode)current).varname = textBuffer.ToString(); } } textBuffer.Length = 0; }
public override bool execute(System.Text.StringBuilder buffer, System.String locale, System.Collections.IDictionary parameters) { for (System.Collections.IEnumerator it = children.GetEnumerator(); it.MoveNext();) { XLRNode child = (XLRNode)it.Current; if (child.execute(buffer, locale, parameters)) { return(true); } } return(false); }
public virtual XLRTargetNode getTarget(System.String locale) { for (System.Collections.IEnumerator it = children.GetEnumerator(); it.MoveNext();) { XLRNode node = (XLRNode)it.Current; if ((node is XLRTargetNode) && ((XLRTargetNode)node).matchesLocale(locale)) { return((XLRTargetNode)node); } } return(null); }
public virtual bool execute(System.Text.StringBuilder buffer, System.String locale, System.Collections.IDictionary parameters) { bool success = false; //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'" for (System.Collections.IEnumerator it = children.GetEnumerator(); it.MoveNext();) { //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'" XLRNode child = (XLRNode)it.Current; if (child.execute(buffer, locale, parameters)) { success = true; } } return(success); }
public override void startElement(System.String uri, System.String localName, System.String qName, SaxAttributesSupport attributes) { XLRNode current = null; if (context.Count > 0) { current = (XLRNode)context[context.Count - 1]; } // common shortcuts... System.String locale = attributes.GetValue("locale"); if (locale == null) { locale = fileLocale; } System.String text = attributes.GetValue("text"); XLRNode node = null; if ("messages".Equals(qName)) { fileLocale = attributes.GetValue("locale"); if (attributes.GetValue("idbase") != null) { base_Renamed = attributes.GetValue("idbase"); } } else if ("message".Equals(qName)) { System.String id = attributes.GetValue("id"); if (base_Renamed != null) { id = base_Renamed + "." + id; } node = (XLRMessageNode)nodedict[id]; if (node == null) { node = new XLRMessageNode(id); nodedict[id] = node; } if ((text != null) && (locale != null)) // check errors { XLRTargetNode targetNode = new XLRTargetNode(locale); node.children.Add(targetNode); XLRTextNode textNode = new XLRTextNode(text); targetNode.children.Add(textNode); } context.Add(node); } else if ("target".Equals(qName)) { node = new XLRTargetNode(locale); if (text != null) { node.children.Add(new XLRTextNode(text)); } current.children.Add(node); context.Add(node); } else if ("text".Equals(qName)) { System.String value_Renamed = attributes.GetValue("value"); node = new XLRTextNode(value_Renamed); current.children.Add(node); context.Add(node); } else if ("variable".Equals(qName)) { System.String name = attributes.GetValue("name"); node = new XLRVariableNode(name); current.children.Add(node); context.Add(node); } else if ("match".Equals(qName)) { node = new XLRMatchNode(attributes.GetValue("variable"), attributes.GetValue("pattern")); if (text != null) { node.children.Add(new XLRTextNode(text)); } current.children.Add(node); context.Add(node); } else if ("select".Equals(qName)) { node = new XLRChoiceNode(); current.children.Add(node); context.Add(node); } else { //UPGRADE_ISSUE: Constructor 'org.xml.sax.SAXParseException.SAXParseException' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_orgxmlsaxSAXParseExceptionSAXParseException_javalangString_orgxmlsaxLocator'" throw new SAXParseException("blorp", null); // fixme } }