Novell.Directory.Ldap.Rfc2251.RfcFilter.addSubstring C# (CSharp) Method

addSubstring() private method

private addSubstring ( int type, sbyte value_Renamed ) : void
type int
value_Renamed sbyte
return void
        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 ;
        }