public virtual IImageSearch Create(string db, string language, string fieldSource) { var r = Create(); r.Database = db; r.Language = language; var fieldSourceItem = DataWrapper.GetItemByPath(fieldSource, db); var fieldSourceId = fieldSourceItem != null ? fieldSourceItem.ID : ID.Null; r.FieldSourceId = fieldSourceId != ID.Null ? fieldSourceId.ToString() : ""; r.Tags = SearchService.GetTags(language, db, fieldSourceId); var colors = SearchService.GetColors(language, db, fieldSourceId); r.Colors = new List <KeyValuePair <string, string> >(); var converter = new ColorConverter(); foreach (string c in colors) { var colorName = ""; var col = converter.ConvertFromString(c); if (col != null) { var colObj = (Color)col; if (colObj.IsNamedColor) { colorName = colObj.Name; } } r.Colors.Add(new KeyValuePair <string, string>(colorName, c)); } return(r); }