Class ProductsAndGroupsHandler
- Namespace
- Dynamicweb.Ecommerce.Extensibility.Controls
- Assembly
- Dynamicweb.Ecommerce.dll
ProductsAndGroupsHandler class.
public class ProductsAndGroupsHandler : IComparer<Product>, IComparer<Group>
- Inheritance
-
ProductsAndGroupsHandler
- Implements
- Inherited Members
Remarks
The data will be on one of these forms:
[order]
[product][all]
[product][some](productsAndGroupsList)
Where
(productsAndGroupsList) is ((product)|(group))*
(product) is [p:(productID),(variantID)]
(group) is [g:(groupID)]
Constructors
ProductsAndGroupsHandler()
Initializes a new instance of the ProductsAndGroupsHandler class.
public ProductsAndGroupsHandler()
ProductsAndGroupsHandler(HandlerConfigurationType)
Initializes a new instance of the ProductsAndGroupsHandler class.
public ProductsAndGroupsHandler(HandlerConfigurationType type)
Parameters
type
HandlerConfigurationType- The type.
ProductsAndGroupsHandler(string)
Initializes a new instance of the ProductsAndGroupsHandler class.
public ProductsAndGroupsHandler(string data)
Parameters
data
string- The data.
ProductsAndGroupsHandler(string, HandlerConfigurationType)
Initializes a new instance of the ProductsAndGroupsHandler class.
public ProductsAndGroupsHandler(string data, HandlerConfigurationType defaultDataType)
Parameters
data
string- The data.
defaultDataType
HandlerConfigurationType- Default type of the data.
Properties
GroupIds
protected IList<string> GroupIds { get; set; }
Property Value
GroupsSelected
Gets or sets the groups selected.
public IList<Group> GroupsSelected { get; set; }
Property Value
GroupsWithIncludedChildGroups
Gets the groups with included child groups.
public IList<Group> GroupsWithIncludedChildGroups { get; }
Property Value
IncludeChildGroups
Gets or sets a value indicating whether [include child groups].
public bool IncludeChildGroups { get; set; }
Property Value
- bool
true
if [include child groups]; otherwise,false
.
ProductIds
protected IList<string> ProductIds { get; set; }
Property Value
ProductsSelected
Gets or sets the products selected.
public IList<Product> ProductsSelected { get; set; }
Property Value
QueriesSelected
Gets or sets the queries selected.
public IList<IQuery> QueriesSelected { get; set; }
Property Value
QueryIds
protected IList<string> QueryIds { get; set; }
Property Value
SearchesSelected
Gets or sets the searches selected.
public IList<string> SearchesSelected { get; set; }
Property Value
ShopSelected
Gets or sets the shop selected.
public string ShopSelected { get; set; }
Property Value
- string
- The shop selected.
Type
Gets or sets the type.
public HandlerConfigurationType Type { get; set; }
Property Value
- HandlerConfigurationType
- The type.
Methods
ClearCache()
Clears the cache.
public static void ClearCache()
Compare(Group, Group)
Compares the specified x.
public int Compare(Group x, Group y)
Parameters
Returns
- int
- System.Int32.
Compare1(Product, Product)
Compare1s the specified x.
public int Compare1(Product x, Product y)
Parameters
Returns
- int
- System.Int32.
GetFullQueryName(string)
public string GetFullQueryName(string queryIdentifier)
Parameters
queryIdentifier
string
Returns
GetGroupsAndChildGroups(IEnumerable<Group>)
Gets a list of the given Groups including all their child groups.
public static IEnumerable<Group> GetGroupsAndChildGroups(IEnumerable<Group> groups)
Parameters
groups
IEnumerable<Group>- The groups to expand with child groups.
Returns
- IEnumerable<Group>
- A list of groups and their child groups.
GetQueryIdentifier(IQuery)
public static string GetQueryIdentifier(IQuery query)
Parameters
query
IQuery
Returns
GetQueryName(IQuery)
public static string GetQueryName(IQuery query)
Parameters
query
IQuery
Returns
GetQueryRepository(string)
public string GetQueryRepository(string queryIdentifier)
Parameters
queryIdentifier
string
Returns
IsEmpty()
Determines whether this instance is empty.
public bool IsEmpty()
Returns
- bool
true
if this instance is empty; otherwise,false
.
IsProductIncluded(Product)
Determines whether [is product included] [the specified product].
public bool IsProductIncluded(Product product)
Parameters
product
Product- The product.
Returns
- bool
true
if [is product included] [the specified product]; otherwise,false
.
LoadData(string)
Loads the given
data
, and returns a new ProductsAndGroupsHandler instance.
Products and Groups are not loaded from database,
so the returned instance should only be used to determine whether a specific product or group exists by using IsProductIncluded(Product).public static ProductsAndGroupsHandler LoadData(string data)
Parameters
data
string- The config data to load.
Returns
- ProductsAndGroupsHandler
- ProductsAndGroupsHandler.
LoadData(string, HandlerConfigurationType)
Loads the given
data
, and returns a new ProductsAndGroupsHandler instance.
Products and Groups are not loaded from database,
so the returned instance should only be used to determine whether a specific product or group exists by using IsProductIncluded(Product).public static ProductsAndGroupsHandler LoadData(string data, HandlerConfigurationType defaultDataType)
Parameters
data
string- The config data to load.
defaultDataType
HandlerConfigurationType- The default type for the data. If data specifies a different type, the type from data is used.
Returns
- ProductsAndGroupsHandler
- ProductsAndGroupsHandler.
ParseData(string)
Parses the data.
public ParseResult ParseData(string data)
Parameters
data
string- The data.
Returns
- ParseResult
- ParseResult.
ParseData(string, HandlerConfigurationType)
Parses the data.
public ParseResult ParseData(string data, HandlerConfigurationType defaultDataType)
Parameters
data
string- The data.
defaultDataType
HandlerConfigurationType- Default type of the data.
Returns
- ParseResult
- ParseResult.
ParseData(string, bool)
Parses the data.
public ParseResult ParseData(string data, bool loadDataFromDatabase)
Parameters
Returns
- ParseResult
- ParseResult.
ParseData(string, bool, HandlerConfigurationType)
Parses the data.
public ParseResult ParseData(string data, bool loadDataFromDatabase, HandlerConfigurationType defaultDataType)
Parameters
data
string- The data.
loadDataFromDatabase
bool- if set to
true
[load data from database]. defaultDataType
HandlerConfigurationType- Default type of the data.
Returns
- ParseResult
- ParseResult.
ToString()
Returns a string that represents this instance.
public override string ToString()
Returns
ToStringOnlyElements()
To the string only elements.
public string ToStringOnlyElements()
Returns
- string
- System.String.