public virtual void addSubstring(int type, sbyte[] value_Renamed)
{
try
{
Asn1SequenceOf substringSeq = (Asn1SequenceOf) filterStack.Peek();
if (type != INITIAL && type != ANY && type != FINAL)
{
throw new LdapLocalException("Attempt to add an invalid " + "substring type", LdapException.FILTER_ERROR);
}
if (type == INITIAL && substringSeq.size() != 0)
{
throw new LdapLocalException("Attempt to add an initial " + "substring match after the first substring", LdapException.FILTER_ERROR);
}
if (finalFound)
{
throw new LdapLocalException("Attempt to add a substring " + "match after a final substring match", LdapException.FILTER_ERROR);
}
if (type == FINAL)
{
finalFound = true;
}
substringSeq.add(new Asn1Tagged(new Asn1Identifier(Asn1Identifier.CONTEXT, false, type), new RfcLdapString(value_Renamed), false));
}
catch (System.InvalidCastException e)
{
throw new LdapLocalException("A call to addSubstring occured " + "without calling startSubstring", LdapException.FILTER_ERROR);
}
return ;
}