IEnumerable <ServiceElement> searchForServiceTypeUris(Util.Func <Protocol, string> p) { var xpath = new StringBuilder(); xpath.Append("xrd:Service["); foreach (var protocol in Protocol.AllVersions) { string typeUri = p(protocol); if (typeUri == null) { continue; } xpath.Append("xrd:Type/text()='"); xpath.Append(typeUri); xpath.Append("' or "); } xpath.Length -= 4; xpath.Append("]"); var services = new List <ServiceElement>(); foreach (XPathNavigator service in Node.Select(xpath.ToString(), XmlNamespaceResolver)) { services.Add(new ServiceElement(service, this)); } // Put the services in their own defined priority order services.Sort(); return(services); }
public DHSha(HashAlgorithm algorithm, Util.Func <Protocol, string> getName) { if (algorithm == null) { throw new ArgumentNullException("algorithm"); } if (getName == null) { throw new ArgumentNullException("getName"); } GetName = getName; Algorithm = algorithm; }
public DHSha(HashAlgorithm algorithm, Util.Func<Protocol, string> getName) { if (algorithm == null) throw new ArgumentNullException("algorithm"); if (getName == null) throw new ArgumentNullException("getName"); GetName = getName; Algorithm = algorithm; }