当前位置: 首页>>代码示例>>C#>>正文


C# StringExpressionSet.AddExpressions方法代码示例

本文整理汇总了C#中System.Security.Util.StringExpressionSet.AddExpressions方法的典型用法代码示例。如果您正苦于以下问题:C# StringExpressionSet.AddExpressions方法的具体用法?C# StringExpressionSet.AddExpressions怎么用?C# StringExpressionSet.AddExpressions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Security.Util.StringExpressionSet的用法示例。


在下文中一共展示了StringExpressionSet.AddExpressions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Intersect

        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 );
        }
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:68,代码来源:fileiopermission.cs

示例2: Intersect

 public FileIOAccess Intersect(FileIOAccess operand)
 {
     if (operand == null)
     {
         return null;
     }
     if (this.m_allFiles)
     {
         if (operand.m_allFiles)
         {
             return new FileIOAccess(true, false, this.m_pathDiscovery);
         }
         return new FileIOAccess(operand.m_set.Copy(), false, operand.m_allLocalFiles, this.m_pathDiscovery);
     }
     if (operand.m_allFiles)
     {
         return new FileIOAccess(this.m_set.Copy(), false, this.m_allLocalFiles, this.m_pathDiscovery);
     }
     StringExpressionSet set = new StringExpressionSet(this.m_ignoreCase, true);
     if (this.m_allLocalFiles)
     {
         string[] strArray = operand.m_set.ToStringArray();
         if (strArray != null)
         {
             for (int i = 0; i < strArray.Length; i++)
             {
                 string root = GetRoot(strArray[i]);
                 if ((root != null) && IsLocalDrive(GetRoot(root)))
                 {
                     set.AddExpressions(new string[] { strArray[i] }, true, false);
                 }
             }
         }
     }
     if (operand.m_allLocalFiles)
     {
         string[] strArray2 = this.m_set.ToStringArray();
         if (strArray2 != null)
         {
             for (int j = 0; j < strArray2.Length; j++)
             {
                 string path = GetRoot(strArray2[j]);
                 if ((path != null) && IsLocalDrive(GetRoot(path)))
                 {
                     set.AddExpressions(new string[] { strArray2[j] }, true, false);
                 }
             }
         }
     }
     string[] strArray3 = this.m_set.Intersect(operand.m_set).ToStringArray();
     if (strArray3 != null)
     {
         set.AddExpressions(strArray3, !set.IsEmpty(), false);
     }
     return new FileIOAccess(set, false, this.m_allLocalFiles && operand.m_allLocalFiles, this.m_pathDiscovery);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:56,代码来源:FileIOAccess.cs


注:本文中的System.Security.Util.StringExpressionSet.AddExpressions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。