本文整理汇总了C#中ISet.GetEnumerator方法的典型用法代码示例。如果您正苦于以下问题:C# ISet.GetEnumerator方法的具体用法?C# ISet.GetEnumerator怎么用?C# ISet.GetEnumerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISet
的用法示例。
在下文中一共展示了ISet.GetEnumerator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckPermittedDN
private void CheckPermittedDN(ISet permitted, Asn1Sequence dns)
//throws PkixNameConstraintValidatorException
{
if (permitted == null)
{
return;
}
if ((permitted.Count == 0) && dns.Count == 0)
{
return;
}
IEnumerator it = permitted.GetEnumerator();
while (it.MoveNext())
{
Asn1Sequence subtree = (Asn1Sequence)it.Current;
if (WithinDNSubtree(dns, subtree))
{
return;
}
}
throw new PkixNameConstraintValidatorException(
"Subject distinguished name is not from a permitted subtree");
}
示例2: TypesFor
public static IDictionary TypesFor(LocalObjectContainer db, ISet ids
)
{
IDictionary id2clazzes = new Hashtable();
var iter = db.ClassCollection().Iterator();
while (iter.MoveNext())
{
for (var idIter = ids.GetEnumerator(); idIter.MoveNext();)
{
var id = ((int) idIter.Current);
var clazz = iter.CurrentClass();
var btree = BTreeClassIndexStrategy.Btree(clazz);
if (btree.Search(db.SystemTransaction(), id) != null)
{
var clazzes = ((ISet) id2clazzes[id]);
if (clazzes == null)
{
clazzes = new HashSet();
id2clazzes[id] = clazzes;
}
clazzes.Add(clazz);
}
}
}
IDictionary id2clazz = new Hashtable();
for (var idIter = id2clazzes.Keys.GetEnumerator(); idIter.MoveNext();)
{
var id = ((int) idIter.Current);
var clazzes = ((ISet) id2clazzes[id]);
ClassMetadata mostSpecific = null;
for (var curClazzIter = clazzes.GetEnumerator(); curClazzIter.MoveNext();)
{
var curClazz = ((ClassMetadata) curClazzIter.Current);
for (var cmpClazzIter = clazzes.GetEnumerator(); cmpClazzIter.MoveNext();)
{
var cmpClazz = ((ClassMetadata) cmpClazzIter.Current);
if (curClazz.Equals(cmpClazz._ancestor))
{
goto OUTER_continue;
}
}
mostSpecific = curClazz;
break;
OUTER_continue:
;
}
id2clazz[id] = mostSpecific;
}
return id2clazz;
}
示例3: CheckExcludedEmail
private void CheckExcludedEmail(ISet excluded, String email)
//throws PkixNameConstraintValidatorException
{
if (excluded.IsEmpty)
{
return;
}
IEnumerator it = excluded.GetEnumerator();
while (it.MoveNext())
{
String str = (String)it.Current;
if (EmailIsConstrained(email, str))
{
throw new PkixNameConstraintValidatorException(
"Email address is from an excluded subtree.");
}
}
}
示例4: UnionIP
/**
* Returns the union of the excluded IP ranges in <code>excluded</code>
* with <code>ip</code>.
*
* @param excluded A <code>Set</code> of excluded IP addresses with their
* subnet mask as byte arrays.
* @param ip The IP address with its subnet mask.
* @return The <code>Set</code> of excluded IP ranges unified with
* <code>ip</code> as byte arrays.
*/
private ISet UnionIP(ISet excluded, byte[] ip)
{
if (excluded.IsEmpty)
{
if (ip == null)
{
return excluded;
}
excluded.Add(ip);
return excluded;
}
else
{
ISet union = new HashSet();
IEnumerator it = excluded.GetEnumerator();
while (it.MoveNext())
{
byte[] _excluded = (byte[])it.Current;
union.AddAll(UnionIPRange(_excluded, ip));
}
return union;
}
}
示例5: CheckPermittedEmail
private void CheckPermittedEmail(ISet permitted, String email)
//throws PkixNameConstraintValidatorException
{
if (permitted == null)
{
return;
}
IEnumerator it = permitted.GetEnumerator();
while (it.MoveNext())
{
String str = ((String)it.Current);
if (EmailIsConstrained(email, str))
{
return;
}
}
if (email.Length == 0 && permitted.Count == 0)
{
return;
}
throw new PkixNameConstraintValidatorException(
"Subject email address is not from a permitted subtree.");
}
示例6: UnionEmail
private ISet UnionEmail(ISet excluded, String email)
{
if (excluded.IsEmpty)
{
if (email == null)
{
return excluded;
}
excluded.Add(email);
return excluded;
}
else
{
ISet union = new HashSet();
IEnumerator it = excluded.GetEnumerator();
while (it.MoveNext())
{
String _excluded = (String)it.Current;
unionEmail(_excluded, email, union);
}
return union;
}
}
示例7: IntersectIP
/**
* Returns the intersection of the permitted IP ranges in
* <code>permitted</code> with <code>ip</code>.
*
* @param permitted A <code>Set</code> of permitted IP addresses with
* their subnet mask as byte arrays.
* @param ips The IP address with its subnet mask.
* @return The <code>Set</code> of permitted IP ranges intersected with
* <code>ip</code>.
*/
private ISet IntersectIP(ISet permitted, ISet ips)
{
ISet intersect = new HashSet();
for (IEnumerator it = ips.GetEnumerator(); it.MoveNext(); )
{
byte[] ip = Asn1OctetString.GetInstance(
((GeneralSubtree)it.Current).Base.Name).GetOctets();
if (permitted == null)
{
if (ip != null)
{
intersect.Add(ip);
}
}
else
{
IEnumerator it2 = permitted.GetEnumerator();
while (it2.MoveNext())
{
byte[] _permitted = (byte[])it2.Current;
intersect.AddAll(IntersectIPRange(_permitted, ip));
}
}
}
return intersect;
}
示例8: CheckPermittedDNS
private void CheckPermittedDNS(ISet permitted, String dns)
//throws PkixNameConstraintValidatorException
{
if (permitted == null)
{
return;
}
IEnumerator it = permitted.GetEnumerator();
while (it.MoveNext())
{
String str = ((String)it.Current);
// is sub domain
if (WithinDomain(dns, str) || dns.ToUpper().Equals(str.ToUpper()))
{
return;
}
}
if (dns.Length == 0 && permitted.Count == 0)
{
return;
}
throw new PkixNameConstraintValidatorException(
"DNS is not from a permitted subtree.");
}
示例9: intersectDNS
private ISet intersectDNS(ISet permitted, ISet dnss)
{
ISet intersect = new HashSet();
for (IEnumerator it = dnss.GetEnumerator(); it.MoveNext(); )
{
String dns = ExtractNameAsString(((GeneralSubtree)it.Current)
.Base);
if (permitted == null)
{
if (dns != null)
{
intersect.Add(dns);
}
}
else
{
IEnumerator _iter = permitted.GetEnumerator();
while (_iter.MoveNext())
{
String _permitted = (String)_iter.Current;
if (WithinDomain(_permitted, dns))
{
intersect.Add(_permitted);
}
else if (WithinDomain(dns, _permitted))
{
intersect.Add(dns);
}
}
}
}
return intersect;
}
示例10: CheckPermittedURI
private void CheckPermittedURI(ISet permitted, String uri)
// throws PkixNameConstraintValidatorException
{
if (permitted == null)
{
return;
}
IEnumerator it = permitted.GetEnumerator();
while (it.MoveNext())
{
String str = ((String)it.Current);
if (IsUriConstrained(uri, str))
{
return;
}
}
if (uri.Length == 0 && permitted.Count == 0)
{
return;
}
throw new PkixNameConstraintValidatorException(
"URI is not from a permitted subtree.");
}
示例11: UnionDN
private ISet UnionDN(ISet excluded, Asn1Sequence dn)
{
if (excluded.IsEmpty)
{
if (dn == null)
{
return excluded;
}
excluded.Add(dn);
return excluded;
}
else
{
ISet intersect = new HashSet();
IEnumerator it = excluded.GetEnumerator();
while (it.MoveNext())
{
Asn1Sequence subtree = (Asn1Sequence)it.Current;
if (WithinDNSubtree(dn, subtree))
{
intersect.Add(subtree);
}
else if (WithinDNSubtree(subtree, dn))
{
intersect.Add(dn);
}
else
{
intersect.Add(subtree);
intersect.Add(dn);
}
}
return intersect;
}
}
示例12: IntersectDN
private ISet IntersectDN(ISet permitted, ISet dns)
{
ISet intersect = new HashSet();
for (IEnumerator it = dns.GetEnumerator(); it.MoveNext(); )
{
Asn1Sequence dn = Asn1Sequence.GetInstance(((GeneralSubtree)it
.Current).Base.Name.ToAsn1Object());
if (permitted == null)
{
if (dn != null)
{
intersect.Add(dn);
}
}
else
{
IEnumerator _iter = permitted.GetEnumerator();
while (_iter.MoveNext())
{
Asn1Sequence subtree = (Asn1Sequence)_iter.Current;
if (WithinDNSubtree(dn, subtree))
{
intersect.Add(dn);
}
else if (WithinDNSubtree(subtree, dn))
{
intersect.Add(subtree);
}
}
}
}
return intersect;
}
示例13: unionURI
private ISet unionURI(ISet excluded, String uri)
{
if (excluded.IsEmpty)
{
if (uri == null)
{
return excluded;
}
excluded.Add(uri);
return excluded;
}
else
{
ISet union = new HashSet();
IEnumerator _iter = excluded.GetEnumerator();
while (_iter.MoveNext())
{
String _excluded = (String)_iter.Current;
unionURI(_excluded, uri, union);
}
return union;
}
}
示例14: intersectURI
private ISet intersectURI(ISet permitted, ISet uris)
{
ISet intersect = new HashSet();
for (IEnumerator it = uris.GetEnumerator(); it.MoveNext(); )
{
String uri = ExtractNameAsString(((GeneralSubtree)it.Current)
.Base);
if (permitted == null)
{
if (uri != null)
{
intersect.Add(uri);
}
}
else
{
IEnumerator _iter = permitted.GetEnumerator();
while (_iter.MoveNext())
{
String _permitted = (String)_iter.Current;
intersectURI(_permitted, uri, intersect);
}
}
}
return intersect;
}
示例15: checkExcludedURI
private void checkExcludedURI(ISet excluded, String uri)
// throws PkixNameConstraintValidatorException
{
if (excluded.IsEmpty)
{
return;
}
IEnumerator it = excluded.GetEnumerator();
while (it.MoveNext())
{
String str = ((String)it.Current);
if (IsUriConstrained(uri, str))
{
throw new PkixNameConstraintValidatorException(
"URI is from an excluded subtree.");
}
}
}