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
typeHandlerConfigurationType- The type.
ProductsAndGroupsHandler(string)
Initializes a new instance of the ProductsAndGroupsHandler class.
public ProductsAndGroupsHandler(string data)
Parameters
datastring- The data.
ProductsAndGroupsHandler(string, HandlerConfigurationType)
Initializes a new instance of the ProductsAndGroupsHandler class.
public ProductsAndGroupsHandler(string data, HandlerConfigurationType defaultDataType)
Parameters
datastring- The data.
defaultDataTypeHandlerConfigurationType- 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
trueif [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
queryIdentifierstring
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
groupsIEnumerable<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
queryIQuery
Returns
GetQueryName(IQuery)
public static string GetQueryName(IQuery query)
Parameters
queryIQuery
Returns
GetQueryRepository(string)
public string GetQueryRepository(string queryIdentifier)
Parameters
queryIdentifierstring
Returns
IsEmpty()
Determines whether this instance is empty.
public bool IsEmpty()
Returns
- bool
trueif this instance is empty; otherwise,false.
IsProductIncluded(Product)
Determines whether [is product included] [the specified product].
public bool IsProductIncluded(Product product)
Parameters
productProduct- The product.
Returns
- bool
trueif [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
datastring- 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
datastring- The config data to load.
defaultDataTypeHandlerConfigurationType- 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
datastring- The data.
Returns
- ParseResult
- ParseResult.
ParseData(string, HandlerConfigurationType)
Parses the data.
public ParseResult ParseData(string data, HandlerConfigurationType defaultDataType)
Parameters
datastring- The data.
defaultDataTypeHandlerConfigurationType- 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
datastring- The data.
loadDataFromDatabasebool- if set to
true[load data from database]. defaultDataTypeHandlerConfigurationType- 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.