public abstract void CreateAttribute(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] String text, int textLength, int prefixLength);
public override void CreateNode(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { if (nType == ConfigNodeType.Element) { this.lastProcessed = "<" + text + ">"; if ((this.parsing || (this.bNoSearchPath && (string.Compare(text, this.treeRootPath[0], StringComparison.OrdinalIgnoreCase) == 0))) || (((this.depth == this.searchDepth) && (this.searchDepth == this.pathDepth)) && (string.Compare(text, this.treeRootPath[this.pathDepth], StringComparison.OrdinalIgnoreCase) == 0))) { this.parsing = true; ConfigNode currentNode = this.currentNode; this.currentNode = new ConfigNode(text, currentNode); if (this.rootNode == null) { this.rootNode = this.currentNode; } else { currentNode.AddChild(this.currentNode); } } else { this.depth++; } } else if ((nType == ConfigNodeType.PCData) && (this.currentNode != null)) { this.currentNode.Value = text; } }
public void BeginChildren(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { if ((!this.parsing && !this.bNoSearchPath) && ((this.depth == (this.searchDepth + 1)) && (string.Compare(text, this.treeRootPath[this.searchDepth], StringComparison.Ordinal) == 0))) { this.searchDepth++; } }
public override void BeginChildren(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { if ((!this.parsing && !this.bNoSearchPath) && ((this.depth == (this.searchDepth + 1)) && (string.Compare(text, this.treeRootPath[this.searchDepth], StringComparison.Ordinal) == 0))) { this.searchDepth++; } }
public override void EndChildren(int fEmpty, int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { this.lastProcessed = text; this.lastProcessedEndElement = true; if (this.parsing) { if (this.currentNode == this.rootNode) { this.parsing = false; } this.currentNode = this.currentNode.Parent; } else { if (nType != ConfigNodeType.Element) { return; } if (this.depth == this.searchDepth && string.Compare(text, this.treeRootPath[this.searchDepth - 1], StringComparison.Ordinal) == 0) { this.searchDepth = this.searchDepth - 1; this.depth = this.depth - 1; } else { this.depth = this.depth - 1; } } }
public void CreateNode(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { if (nType == ConfigNodeType.Element) { this.lastProcessed = "<" + text + ">"; if ((this.parsing || (this.bNoSearchPath && (string.Compare(text, this.treeRootPath[0], StringComparison.OrdinalIgnoreCase) == 0))) || (((this.depth == this.searchDepth) && (this.searchDepth == this.pathDepth)) && (string.Compare(text, this.treeRootPath[this.pathDepth], StringComparison.OrdinalIgnoreCase) == 0))) { this.parsing = true; ConfigNode currentNode = this.currentNode; this.currentNode = new ConfigNode(text, currentNode); if (this.rootNode == null) { this.rootNode = this.currentNode; } else { currentNode.AddChild(this.currentNode); } } else { this.depth++; } } else if ((nType == ConfigNodeType.PCData) && (this.currentNode != null)) { this.currentNode.Value = text; } }
public void EndChildren(int fEmpty, int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] String text, int textLength, int prefixLength) { lastProcessed = "</" + text + ">"; if (parsing) { //Trace("EndChildren",size,subType,nType,terminal,text,textLength,prefixLength,fEmpty); if (currentNode == rootNode) { // End of section of tree which is parsed parsing = false; } currentNode = currentNode.Parent; } else if (nType == ConfigNodeType.Element) { if (depth == searchDepth && String.Compare(text, treeRootPath[searchDepth - 1], false, CultureInfo.InvariantCulture) == 0) { searchDepth--; depth--; } else { depth--; } } }
public override void CreateNode(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { if (nType == ConfigNodeType.Element) { this.lastProcessed = text; this.lastProcessedEndElement = false; if (this.parsing || this.bNoSearchPath && string.Compare(text, this.treeRootPath[0], StringComparison.OrdinalIgnoreCase) == 0 || this.depth == this.searchDepth && this.searchDepth == this.pathDepth && string.Compare(text, this.treeRootPath[this.pathDepth], StringComparison.OrdinalIgnoreCase) == 0) { this.parsing = true; ConfigNode parent = this.currentNode; this.currentNode = new ConfigNode(text, parent); if (this.rootNode == null) { this.rootNode = this.currentNode; } else { parent.AddChild(this.currentNode); } } else { this.depth = this.depth + 1; } } else { if (nType != ConfigNodeType.PCData || this.currentNode == null) { return; } this.currentNode.Value = text; } }
public void CreateAttribute(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] String text, int textLength, int prefixLength) { //Trace("CreateAttribute",size,subType,nType,terminal,text,textLength,prefixLength,0); if (parsing) { // if the value of the attribute is null, the parser doesn't come back, so need to store the attribute when the // attribute name is encountered if (nType == ConfigNodeType.Attribute) { attributeEntry = currentNode.AddAttribute(text, ""); key = text; } else if (nType == ConfigNodeType.PCData) { currentNode.ReplaceAttribute(attributeEntry, key, text); } else { throw new ApplicationException(String.Format(Environment.GetResourceString("XML_Syntax_InvalidSyntaxInFile"), fileName, lastProcessed)); } } }
public abstract void BeginChildren(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] String text, int textLength, int prefixLength);
public override void CreateAttribute(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] String text, int textLength, int prefixLength) { //Trace("CreateAttribute",size,subType,nType,terminal,text,textLength,prefixLength,0); if (parsing) { // if the value of the attribute is null, the parser doesn't come back, so need to store the attribute when the // attribute name is encountered if (nType == ConfigNodeType.Attribute) { attributeEntry = currentNode.AddAttribute(text, ""); key = text; } else if (nType == ConfigNodeType.PCData) { currentNode.ReplaceAttribute(attributeEntry, key, text); } else { String message = GetInvalidSyntaxMessage(); // Neither Exception nor ApplicationException are the "right" exceptions here. // Desktop throws ApplicationException for backwards compatibility. // On Silverlight we don't have ApplicationException, so fall back to Exception. throw new Exception(message); } } }
public override void BeginChildren(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { if (this.parsing || this.bNoSearchPath || (this.depth != this.searchDepth + 1 || string.Compare(text, this.treeRootPath[this.searchDepth], StringComparison.Ordinal) != 0)) { return; } this.searchDepth = this.searchDepth + 1; }
public void Error(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] String text, int textLength, int prefixLength) { //Trace("Error",size,subType,nType,terminal,text,textLength,prefixLength,0); }
public override void CreateNode(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] String text, int textLength, int prefixLength) { //Trace("CreateNode",size,subType,nType,terminal,text,textLength,prefixLength,0); if (nType == ConfigNodeType.Element) { // New Node lastProcessed = text; lastProcessedEndElement = false; if (parsing || (bNoSearchPath && String.Compare(text, treeRootPath[0], StringComparison.OrdinalIgnoreCase) == 0) || (depth == searchDepth && searchDepth == pathDepth && String.Compare(text, treeRootPath[pathDepth], StringComparison.OrdinalIgnoreCase) == 0)) { parsing = true; ConfigNode parentNode = currentNode; currentNode = new ConfigNode(text, parentNode); if (rootNode == null) { rootNode = currentNode; } else { parentNode.AddChild(currentNode); } } else { depth++; } } else if (nType == ConfigNodeType.PCData) { // Data node if (currentNode != null) { currentNode.Value = text; } } }
public void BeginChildren(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] String text, int textLength, int prefixLength) { //Trace("BeginChildren",size,subType,nType,terminal,text,textLength,prefixLength,0); if (!parsing && (!bNoSearchPath && depth == (searchDepth + 1) && String.Compare(text, treeRootPath[searchDepth], false, CultureInfo.InvariantCulture) == 0)) { searchDepth++; } }
public void CreateNode(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] String text, int textLength, int prefixLength) { //Trace("CreateNode",size,subType,nType,terminal,text,textLength,prefixLength,0); if (nType == ConfigNodeType.Element) { // New Node lastProcessed = "<" + text + ">"; if (parsing || (bNoSearchPath && String.Compare(text, treeRootPath[0], true, CultureInfo.InvariantCulture) == 0) || (depth == searchDepth && searchDepth == pathDepth && String.Compare(text, treeRootPath[pathDepth], true, CultureInfo.InvariantCulture) == 0)) { parsing = true; ConfigNode parentNode = currentNode; currentNode = new ConfigNode(text, parentNode); if (rootNode == null) { rootNode = currentNode; } else { parentNode.AddChild(currentNode); } } else if (nType == ConfigNodeType.PCData) { // Data node currentNode.Value = text; } else { depth++; } } }
public override void CreateAttribute(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { if (this.parsing) { if (nType == ConfigNodeType.Attribute) { this.attributeEntry = this.currentNode.AddAttribute(text, ""); this.key = text; } else { if (nType != ConfigNodeType.PCData) { throw new ApplicationException(Environment.GetResourceString("XML_Syntax_InvalidSyntaxInFile", new object[] { this.fileName, this.lastProcessed })); } this.currentNode.ReplaceAttribute(this.attributeEntry, this.key, text); } } }
private void Trace(String name, int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] String text, int textLength, int prefixLength, int fEmpty) { BCLDebug.Trace("REMOTE", "Node " + name); BCLDebug.Trace("REMOTE", "text " + text); BCLDebug.Trace("REMOTE", "textLength " + textLength); BCLDebug.Trace("REMOTE", "size " + size); BCLDebug.Trace("REMOTE", "subType " + ((Enum)subType).ToString()); BCLDebug.Trace("REMOTE", "nType " + ((Enum)nType).ToString()); BCLDebug.Trace("REMOTE", "terminal " + terminal); BCLDebug.Trace("REMOTE", "prefixLength " + prefixLength); BCLDebug.Trace("REMOTE", "fEmpty " + fEmpty + "\n"); }
public void CreateAttribute(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { if (this.parsing) { if (nType == ConfigNodeType.Attribute) { this.attributeEntry = this.currentNode.AddAttribute(text, ""); this.key = text; } else { if (nType != ConfigNodeType.PCData) { throw new ApplicationException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("XML_Syntax_InvalidSyntaxInFile"), new object[] { this.fileName, this.lastProcessed })); } this.currentNode.ReplaceAttribute(this.attributeEntry, this.key, text); } } }
public override void CreateAttribute(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { if (!this.parsing) { return; } if (nType == ConfigNodeType.Attribute) { this.attributeEntry = this.currentNode.AddAttribute(text, ""); this.key = text; } else { if (nType != ConfigNodeType.PCData) { throw new ApplicationException(this.GetInvalidSyntaxMessage()); } this.currentNode.ReplaceAttribute(this.attributeEntry, this.key, text); } }
public void EndChildren(int fEmpty, int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { this.lastProcessed = "</" + text + ">"; if (this.parsing) { if (this.currentNode == this.rootNode) { this.parsing = false; } this.currentNode = this.currentNode.Parent; } else if (nType == ConfigNodeType.Element) { if ((this.depth == this.searchDepth) && (string.Compare(text, this.treeRootPath[this.searchDepth - 1], StringComparison.Ordinal) == 0)) { this.searchDepth--; this.depth--; } else { this.depth--; } } }
public override void CreateAttribute(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { if (!this.parsing) { return; } if (nType == ConfigNodeType.Attribute) { this.attributeEntry = this.currentNode.AddAttribute(text, ""); this.key = text; return; } if (nType == ConfigNodeType.PCData) { this.currentNode.ReplaceAttribute(this.attributeEntry, this.key, text); return; } string resourceString = Environment.GetResourceString("XML_Syntax_InvalidSyntaxInFile", new object[] { this.fileName, this.lastProcessed }); throw new ApplicationException(resourceString); }
public void EndChildren(int fEmpty, int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] String text, int textLength, int prefixLength) { lastProcessed = "</"+text+">"; if (parsing) { //Trace("EndChildren",size,subType,nType,terminal,text,textLength,prefixLength,fEmpty); if (currentNode == rootNode) { // End of section of tree which is parsed parsing = false; } currentNode = currentNode.Parent; } else if (nType == ConfigNodeType.Element){ if(depth == searchDepth && String.Compare(text, treeRootPath[searchDepth - 1], StringComparison.Ordinal) == 0) { searchDepth--; depth--; } else depth--; } }
public abstract void EndChildren(int fEmpty, int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] String text, int textLength, int prefixLength);
private void Trace(string name, int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength, int fEmpty) { }
public void CreateAttribute(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)]String text, int textLength, int prefixLength) { //Trace("CreateAttribute",size,subType,nType,terminal,text,textLength,prefixLength,0); if (parsing) { // if the value of the attribute is null, the parser doesn't come back, so need to store the attribute when the // attribute name is encountered if (nType == ConfigNodeType.Attribute) { attributeEntry = currentNode.AddAttribute(text, ""); key = text; } else if (nType == ConfigNodeType.PCData) { currentNode.ReplaceAttribute(attributeEntry, key, text); } else throw new ApplicationException(String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("XML_Syntax_InvalidSyntaxInFile"),fileName,lastProcessed)); } }
private void Trace(String name, int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)]String text, int textLength, int prefixLength, int fEmpty) { BCLDebug.Trace("REMOTE","Node "+name); BCLDebug.Trace("REMOTE","text "+text); BCLDebug.Trace("REMOTE","textLength "+textLength); BCLDebug.Trace("REMOTE","size "+size); BCLDebug.Trace("REMOTE","subType "+((Enum)subType).ToString()); BCLDebug.Trace("REMOTE","nType "+((Enum)nType).ToString()); BCLDebug.Trace("REMOTE","terminal "+terminal); BCLDebug.Trace("REMOTE","prefixLength "+prefixLength); BCLDebug.Trace("REMOTE","fEmpty "+fEmpty+"\n"); }
public void Error(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)]String text, int textLength, int prefixLength) { //Trace("Error",size,subType,nType,terminal,text,textLength,prefixLength,0); }
public void CreateNode(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)]String text, int textLength, int prefixLength) { //Trace("CreateNode",size,subType,nType,terminal,text,textLength,prefixLength,0); if (nType == ConfigNodeType.Element) { // New Node lastProcessed = "<"+text+">"; if (parsing || (bNoSearchPath && String.Compare(text, treeRootPath[0], StringComparison.OrdinalIgnoreCase) == 0) || (depth == searchDepth && searchDepth == pathDepth && String.Compare(text, treeRootPath[pathDepth], StringComparison.OrdinalIgnoreCase) == 0 )) { parsing = true; ConfigNode parentNode = currentNode; currentNode = new ConfigNode(text, parentNode); if (rootNode == null) rootNode = currentNode; else parentNode.AddChild(currentNode); } else depth++; } else if (nType == ConfigNodeType.PCData) { // Data node if (currentNode != null) { currentNode.Value = text; } } }
public void Error(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { }
public override void CreateAttribute(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)]String text, int textLength, int prefixLength) { //Trace("CreateAttribute",size,subType,nType,terminal,text,textLength,prefixLength,0); if (parsing) { // if the value of the attribute is null, the parser doesn't come back, so need to store the attribute when the // attribute name is encountered if (nType == ConfigNodeType.Attribute) { attributeEntry = currentNode.AddAttribute(text, ""); key = text; } else if (nType == ConfigNodeType.PCData) { currentNode.ReplaceAttribute(attributeEntry, key, text); } else { String message = GetInvalidSyntaxMessage(); // Neither Exception nor ApplicationException are the "right" exceptions here. // Desktop throws ApplicationException for backwards compatibility. // On Silverlight we don't have ApplicationException, so fall back to Exception. #if FEATURE_CORECLR throw new Exception(message); #else throw new ApplicationException(message); #endif } } }
public override void CreateNode(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { if (nType != ConfigNodeType.Element) { if (nType == ConfigNodeType.PCData && this.currentNode != null) { this.currentNode.Value = text; } return; } this.lastProcessed = "<" + text + ">"; if (!this.parsing && (!this.bNoSearchPath || string.Compare(text, this.treeRootPath[0], StringComparison.OrdinalIgnoreCase) != 0) && (this.depth != this.searchDepth || this.searchDepth != this.pathDepth || string.Compare(text, this.treeRootPath[this.pathDepth], StringComparison.OrdinalIgnoreCase) != 0)) { this.depth++; return; } this.parsing = true; ConfigNode configNode = this.currentNode; this.currentNode = new ConfigNode(text, configNode); if (this.rootNode == null) { this.rootNode = this.currentNode; return; } configNode.AddChild(this.currentNode); }
public override void Error(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLength, int prefixLength) { }
public void BeginChildren(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)] String text, int textLength, int prefixLength) { //Trace("BeginChildren",size,subType,nType,terminal,text,textLength,prefixLength,0); if (!parsing && (!bNoSearchPath && depth == (searchDepth + 1) && String.Compare(text, treeRootPath[searchDepth], StringComparison.Ordinal) == 0)) { searchDepth++; } }
public abstract void CreateAttribute(int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [MarshalAs(UnmanagedType.LPWStr)]String text, int textLength, int prefixLength);