/// <exception cref="XMLException"></exception> private ServerConnection readServerConnection(XmlReader xmlReader) { ServerConnection serverConnection = new ServerConnection(); bool finished = false; //serverConnection.setType(xmlReader.getAttributeValue(null, "type")); serverConnection.setType(xmlReader.GetAttribute("type", null)); while(!finished && xmlReader.MoveToNextAttribute()) { //int Event = xmlReader.next(); string name = XmlUtils.getElementQualifiedName(xmlReader, namespaces); switch(xmlReader.NodeType) { case XmlNodeType.Element: if("config:protocol".Equals(name)) { serverConnection.setProtocol(xmlReader.ReadString().Trim()); } else if("config:host".Equals(name)) { serverConnection.setHost(xmlReader.ReadString().Trim()); } else if("config:port".Equals(name)) { serverConnection.setPort(Int32.Parse(xmlReader.ReadString().Trim())); } else if("config:path".Equals(name)) { serverConnection.setPath(xmlReader.ReadString().Trim()); } else if("config:client-application-identification-header-value".Equals(name)) { serverConnection.setClientApplicationIdentificationHeaderValue(xmlReader.ReadString().Trim()); } else { /** unexpected start element **/ } break; case XmlNodeType.EndElement: if("config:server-connection".Equals(name)) { finished = true; } else { /** unexpected end element **/ } break; default: /** unused xml element - nothing to do **/ break; } } return serverConnection; }
public ClientConfiguration setServerConnection(ServerConnection serverConnection) { this.serverConnection = serverConnection; return this; }