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 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
typeHandlerConfigurationTypeThe type.
ProductsAndGroupsHandler(string?)
Initializes a new instance of the ProductsAndGroupsHandler class.
public ProductsAndGroupsHandler(string? data)
Parameters
datastringThe data.
ProductsAndGroupsHandler(string?, HandlerConfigurationType)
Initializes a new instance of the ProductsAndGroupsHandler class.
public ProductsAndGroupsHandler(string? data, HandlerConfigurationType defaultDataType)
Parameters
datastringThe data.
defaultDataTypeHandlerConfigurationTypeDefault 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
ProductKeysSelected
public IList<ProductKey> ProductKeysSelected { 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
AddProduct(ProductKey)
public bool AddProduct(ProductKey productKey)
Parameters
productKeyProductKey
Returns
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
productProductThe 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
datastringThe 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
datastringThe config data to load.
defaultDataTypeHandlerConfigurationTypeThe 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
datastringThe data.
Returns
- ParseResult
ParseResult.
ParseData(string?, HandlerConfigurationType)
Parses the data.
public ParseResult ParseData(string? data, HandlerConfigurationType defaultDataType)
Parameters
datastringThe data.
defaultDataTypeHandlerConfigurationTypeDefault 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
datastringThe data.
loadDataFromDatabaseboolif set to
true[load data from database].defaultDataTypeHandlerConfigurationTypeDefault type of the data.
Returns
- ParseResult
ParseResult.
RemoveProduct(ProductKey)
public bool RemoveProduct(ProductKey productKey)
Parameters
productKeyProductKey
Returns
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.