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); }
public bool Equals(WebPanelItemBase obj) { if (obj == null) { return(false); } return(obj.Name.Equals(this.Name, StringComparison.InvariantCultureIgnoreCase)); }