protected override ListItem[] GetListItems() { ParameterCollection query = Parameter.Equal("State", ContentState.Published); if (LinkedType != null && LinkedType != typeof(ContentItem)) { query &= Parameter.TypeEqual(LinkedType); } if (ExcludedType != null) { query &= Parameter.TypeNotEqual(ExcludedType); } if (!Is(EditableItemSelectionFilter.Pages)) { query &= Parameter.IsNotNull("ZoneName"); } if (!Is(EditableItemSelectionFilter.Parts)) { query &= Parameter.IsNull("ZoneName"); } var items = Engine.Content.Search.Repository.Select(query, "ID", "Title"); return(items.Select(row => new ListItem((string)row["Title"], row["ID"].ToString())) .ToArray()); }
protected virtual IEnumerable <ContentItem> GetDataItemsByIds(params int[] ids) { if (ids == null || ids.Length == 0) { return(Enumerable.Empty <ContentItem>()); } var items = Engine.Content.Search.Repository.Find(Parameter.In("ID", ids)); return(items); }
private bool ValueEquals(Parameter other) { return (Value != null && Value.Equals(other.Value)) || (Value == null && other.Value == null) || (Value is object[] && other.Value is object[] && (Value as object[]).SequenceEqual(other.Value as object[])); }