Пример #1
0
        public static SubDomainItem FindAndMake(string FullName, WebPanelItemCollection topDomainList)
        {
            SubDomainItem foundSubDomain = null;

            if (!string.IsNullOrEmpty(FullName))
            {
                for (int lastPos = 0; lastPos < topDomainList.Count; lastPos++)
                {
                    WebPanelItemBase topDomainNow = topDomainList[lastPos];
                    int pos = FullName.Length - topDomainNow.Name.Length;
                    if (pos <= 1)
                    {
                        continue;
                    }
                    pos = FullName.IndexOf(topDomainNow.Name, (pos - 1)) - 1;
                    if (pos > 0 && FullName[pos] == '.')
                    {
                        foundSubDomain = new SubDomainItem(topDomainNow.Name, FullName.Substring(0, pos));
                        topDomainList.RemoveAt(lastPos);
                        topDomainList.Insert(0, topDomainNow);
                        break;
                    }
                }
            }
            return(foundSubDomain);
        }
Пример #2
0
 public bool Equals(WebPanelItemBase obj)
 {
     if (obj == null)
     {
         return(false);
     }
     return(obj.Name.Equals(this.Name, StringComparison.InvariantCultureIgnoreCase));
 }