public void Add(int id, int relatedSiteId, int relatedIndent, int relatedId, bool enabled) { IContentLink link = null; if (this._contentType == ContentTypeIndent.Archive.ToString().ToLower()) { link = new LinkOfArchive(id, this._contentType, this._contentId, relatedSiteId, relatedIndent, relatedId, enabled); } if (link != null) { foreach (IContentLink link2 in this._links) { if (link2.Equal(link)) { throw new Exception("已存在重名的链接!"); } } this._links.Add(link); } }
public void Add(int linkId, string name, string title, string uri, bool enabled) { ILink link = null; switch (this.TypeIndent) { case "1": link = new LinkOfArchive(linkId, name, title, uri, enabled); break; } if (link != null) { foreach (ILink _link in this._links) { if (_link.Equal(link)) { throw new Exception("已存在重名的链接!"); } } this._links.Add(link); } }