System.Security.Util.SiteString.IsSubsetOf C# (CSharp) Method

IsSubsetOf() public method

public IsSubsetOf ( SiteString operand, bool ignoreCase ) : bool
operand SiteString
ignoreCase bool
return bool
        public virtual bool IsSubsetOf( SiteString operand, bool ignoreCase )
        {
            StringComparison strComp = (ignoreCase? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal);
            if (operand == null)
            {
                return false;
            }
            else if (this.m_separatedSite.Count == operand.m_separatedSite.Count &&
                     this.m_separatedSite.Count == 0)
            {
                return true;
            }
            else if (this.m_separatedSite.Count < operand.m_separatedSite.Count - 1)
            {
                return false;
            }
            else if (this.m_separatedSite.Count > operand.m_separatedSite.Count &&
                     operand.m_separatedSite.Count > 0 &&
                     !operand.m_separatedSite[operand.m_separatedSite.Count-1].Equals( "*" ))
            {
                return false;
            }
            else if (String.Compare( this.m_site, operand.m_site, strComp) == 0)
            {
                return true;
            }
    
            for (int index = 0; index < operand.m_separatedSite.Count - 1; ++index)
            {
                if (String.Compare( (String)this.m_separatedSite[index], (String)operand.m_separatedSite[index], strComp) != 0 )
                {
                    return false;
                }
            }
            
            if (this.m_separatedSite.Count < operand.m_separatedSite.Count)
            {
                return operand.m_separatedSite[operand.m_separatedSite.Count-1].Equals( "*" );
            }
            else if (this.m_separatedSite.Count == operand.m_separatedSite.Count)
            {
                // last item must be the same or operand must have a * in its last item
                return (String.Compare( (String)this.m_separatedSite[this.m_separatedSite.Count-1], 
                                                    (String)operand.m_separatedSite[this.m_separatedSite.Count-1], 
                                                    strComp ) == 0 || 
                           operand.m_separatedSite[operand.m_separatedSite.Count-1].Equals( "*" ));
                    
            }
            else 
                return true;
        }
                

Same methods

SiteString::IsSubsetOf ( SiteString operand ) : bool

Usage Example

 // Token: 0x06002B16 RID: 11030 RVA: 0x0009FEB8 File Offset: 0x0009E0B8
 internal bool Equals(SiteString ss, bool ignoreCase)
 {
     if (this.m_site == null)
     {
         return(ss.m_site == null);
     }
     return(ss.m_site != null && this.IsSubsetOf(ss, ignoreCase) && ss.IsSubsetOf(this, ignoreCase));
 }
All Usage Examples Of System.Security.Util.SiteString::IsSubsetOf