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

addObject() private method

Called by sequential filter building methods to add to a filter component. Verifies that the specified Asn1Object can be added, then adds the object to the filter.
private addObject ( Asn1Object current ) : void
current Novell.Directory.Ldap.Asn1.Asn1Object Filter component to be added to the filter /// @throws LdapLocalException Occurs when an invalid component is added, or /// when the component is out of sequence. ///
return void
        private void addObject(Asn1Object current)
        {
            if (filterStack == null)
            {
                filterStack = new System.Collections.Stack();
            }
            if (choiceValue() == null)
            {
                //ChoiceValue is the root Asn1 node
                ChoiceValue = current;
            }
            else
            {
                Asn1Tagged topOfStack = (Asn1Tagged) filterStack.Peek();
                Asn1Object value_Renamed = topOfStack.taggedValue();
                if (value_Renamed == null)
                {
                    topOfStack.TaggedValue = current;
                    filterStack.Push(current);
            //					filterStack.Add(current);
                }
                else if (value_Renamed is Asn1SetOf)
                {
                    ((Asn1SetOf) value_Renamed).add(current);
                    //don't add this to the stack:
                }
                else if (value_Renamed is Asn1Set)
                {
                    ((Asn1Set) value_Renamed).add(current);
                    //don't add this to the stack:
                }
                else if (value_Renamed.getIdentifier().Tag == LdapSearchRequest.NOT)
                {
                    throw new LdapLocalException("Attemp to create more than one 'not' sub-filter", LdapException.FILTER_ERROR);
                }
            }
            int type = current.getIdentifier().Tag;
            if (type == AND || type == OR || type == NOT)
            {
            //				filterStack.Add(current);
                filterStack.Push(current);
            }
            return ;
        }