static ushort ParsePort (string s) { ushort port; if (!UInt16.TryParse (s, out port) || (port < AccessPolicy.MinPort) || (port > AccessPolicy.MaxPort)) throw new XmlException ("Invalid port"); return port; } }