示例#1
0
        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);
        }
示例#2
0
            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;
            }
示例#3
0
            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;
            }