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

AddExpressions() public method

public AddExpressions ( ArrayList exprArrayList, bool checkForDuplicates ) : void
exprArrayList System.Collections.ArrayList
checkForDuplicates bool
return void
        public void AddExpressions( ArrayList exprArrayList, bool checkForDuplicates)
        {
            BCLDebug.Assert( m_throwOnRelative, "This should only be called when throw on relative is set" );

            m_expressionsArray = null;
            m_expressions = null;

            if (m_list != null)
                m_list.AddRange(exprArrayList);
            else
                m_list = new ArrayList(exprArrayList);
        
            
            if (checkForDuplicates)
                Reduce();
                
        }

Same methods

StringExpressionSet::AddExpressions ( String str ) : void
StringExpressionSet::AddExpressions ( String str, bool checkForDuplicates, bool needFullPath ) : void

Usage Example

Example #1
0
        public FileIOAccess Intersect( FileIOAccess operand )
        {
            if (operand == null)
            {
                return null;
            }
            
            Contract.Assert( this.m_pathDiscovery == operand.m_pathDiscovery, "Path discovery settings must match" );

            if (this.m_allFiles)
            {
                if (operand.m_allFiles)
                {
                    return new FileIOAccess( true, false, this.m_pathDiscovery );
                }
                else
                {
                    return new FileIOAccess( operand.m_set.Copy(), false, operand.m_allLocalFiles, this.m_pathDiscovery );
                }
            }
            else if (operand.m_allFiles)
            {
                return new FileIOAccess( this.m_set.Copy(), false, this.m_allLocalFiles, this.m_pathDiscovery );
            }

            StringExpressionSet intersectionSet = new StringExpressionSet( m_ignoreCase, true );

            if (this.m_allLocalFiles)
            {
                String[] expressions = operand.m_set.UnsafeToStringArray();
                
                if (expressions != null)
                {
                    for (int i = 0; i < expressions.Length; ++i)
                    {
                        String root = GetRoot( expressions[i] );
                        if (root != null && IsLocalDrive( GetRoot( root ) ) )
                        {
                            intersectionSet.AddExpressions( new String[] { expressions[i] }, true, false );
                        }
                    }
                }
            }

            if (operand.m_allLocalFiles)
            {
                String[] expressions = this.m_set.UnsafeToStringArray();

                if (expressions != null)
                {
                    for (int i = 0; i < expressions.Length; ++i)
                    {
                        String root = GetRoot( expressions[i] );
                        if (root != null && IsLocalDrive(GetRoot(root)))
                        {
                            intersectionSet.AddExpressions( new String[] { expressions[i] }, true, false );
                        }
                    }
                }
            }

            String[] regularIntersection = this.m_set.Intersect( operand.m_set ).UnsafeToStringArray();

            if (regularIntersection != null)
                intersectionSet.AddExpressions( regularIntersection, !intersectionSet.IsEmpty(), false );

            return new FileIOAccess( intersectionSet, false, this.m_allLocalFiles && operand.m_allLocalFiles, this.m_pathDiscovery );
        }
All Usage Examples Of System.Security.Util.StringExpressionSet::AddExpressions