public Icon Process(string model) { this.NeedNotNull(model, "icon name"); string name = PortalUtility.UnUrlFormat(model); Icon icon; using (IConnection connection = ConnectionFactory.Create()) { icon = connection.IconByName(name); } if (icon == null) { throw new PortalException(string.Format("Icon '{0}' not found", name)); } return(icon); }
private Icon BuildIconFromMessage(IconPost iconPost, IPostedFile file) { Icon icon = new Icon() { Id = iconPost.Id, Name = iconPost.Name, Link = iconPost.Link }; // Force DB name to be correctly formatted icon.Name = PortalUtility.UnUrlFormat(PortalUtility.UrlFormat(icon.Name)); if (file != null) { icon.Image = PortalUtility.GetImageExtension(file.ContentType); } return(icon); }