Class SaveMethodComboCollection
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
Represents methods for adding and loading SaveMethodCombo objects.
[Serializable]
public class SaveMethodComboCollection : Collection<SaveMethodCombo>, IList<SaveMethodCombo>, ICollection<SaveMethodCombo>, IReadOnlyList<SaveMethodCombo>, IReadOnlyCollection<SaveMethodCombo>, IEnumerable<SaveMethodCombo>, IList, ICollection, IEnumerable
- Inheritance
-
SaveMethodComboCollection
- Implements
- Inherited Members
- Extension Methods
Examples
using System;
using System.Web;
using Dynamicweb.Ecommerce.Products;
namespace Dynamicweb.Ecommerce.Examples.Products
{
public class ProductSaveMethodCombosHandlerSample
{
public SaveMethodComboCollection SaveMethodCombos()
{
var newSaveMethodComboColl = new SaveMethodComboCollection();
foreach (ProductDataBaseField field in Enum.GetValues(typeof(ProductDataBaseField)))
{
var newSaveMethodCombo = new SaveMethodCombo
{
ProductDataBaseField = field,
UpdateType = UpdateType.VariantDependent
};
newSaveMethodComboColl.Add(newSaveMethodCombo);
}
return newSaveMethodComboColl;
}
public SaveMethodComboCollection GetMethodCombos()
{
if (Dynamicweb.Context.Current.Items["Ecom.SaveMethodCombos"] == null)
{
SaveMethodComboCollection tempCol = new SaveMethodComboCollection();
tempCol.LoadCombos();
Dynamicweb.Context.Current.Items["Ecom.SaveMethodCombos"] = tempCol;
}
return (SaveMethodComboCollection)Dynamicweb.Context.Current.Items["Ecom.SaveMethodCombos"];
}
}
}
Methods
GetItemByField(ProductDataBaseField)
public SaveMethodCombo GetItemByField(ProductDataBaseField field)
Parameters
field
ProductDataBaseField
Returns
LoadCombos()
Loads the method combos.
public void LoadCombos()