System.Security.Util.StringExpressionSet.Copy C# (CSharp) Method

Copy() public method

public Copy ( ) : StringExpressionSet
return StringExpressionSet
        public virtual StringExpressionSet Copy()
        {
            StringExpressionSet copy = CreateNewEmpty();
            if (this.m_list != null)
                copy.m_list = new ArrayList( this.m_list );
            copy.m_expressions = this.m_expressions;
            copy.m_ignoreCase = this.m_ignoreCase;
            copy.m_throwOnRelative = this.m_throwOnRelative;
            return copy;
        }
        

Usage Example

        [System.Security.SecurityCritical]  // auto-generated
        public StringExpressionSet Union(StringExpressionSet ses)
        {
            // If either set is empty, the union represents a copy of the other.

            if (ses == null || ses.IsEmpty())
            {
                return(this.Copy());
            }

            if (this.IsEmpty())
            {
                return(ses.Copy());
            }

            CheckList();
            ses.CheckList();

            // Perform the union
            // note: insert smaller set into bigger set to reduce needed comparisons

            StringExpressionSet bigger  = ses.m_list.Count > this.m_list.Count ? ses : this;
            StringExpressionSet smaller = ses.m_list.Count <= this.m_list.Count ? ses : this;

            StringExpressionSet unionSet = bigger.Copy();

            unionSet.Reduce();

            for (int index = 0; index < smaller.m_list.Count; ++index)
            {
                unionSet.AddSingleExpressionNoDuplicates((String)smaller.m_list[index]);
            }

            unionSet.GenerateString();

            return(unionSet);
        }
All Usage Examples Of System.Security.Util.StringExpressionSet::Copy