Dynamicweb.eCommerce.Products Namespace : PropertyProductValueCollection Class |
'Declaration
<DefaultMemberAttribute("Item")> <SerializableAttribute()> Public Class PropertyProductValueCollection Inherits System.Collections.ObjectModel.Collection(Of PropertyProductValue)
[DefaultMemberAttribute("Item")] [SerializableAttribute()] public class PropertyProductValueCollection : System.Collections.ObjectModel.Collection<PropertyProductValue>
class MyPage : System.Web.UI.Page { public void RenderFieldGroups(Product product, Dynamicweb.Rendering.Template template) { PropertyProductValueCollection propertyValues = PropertyProductValue.getPropertyProductValues(product); //Get types, groups, and fields from valueCollection Dictionary<string, object> typeIDs = new Dictionary<string, object>(); Dictionary<string, string> propertyValueDictionary = new Dictionary<string, string>(); foreach (PropertyProductValue propertyValue in propertyValues) { //Type if (!typeIDs.ContainsKey(propertyValue.TypeID)) { typeIDs.Add(propertyValue.TypeID, null); } //Dictionary containing link between field and value if (!propertyValueDictionary.ContainsKey(propertyValue.FieldID)) { propertyValueDictionary.Add(propertyValue.FieldID, propertyValue.Value); } } PropertyTypeCollection propertyTypes = PropertyType.getPropertyTypes(typeIDs.Keys); //Render all the values without loops RenderGroupFieldsValues(propertyTypes, propertyValueDictionary, template); //Render all the values inside 3x loops (type, group, field) RenderGroupFieldTypes(propertyTypes, propertyValueDictionary, template); } private void RenderGroupFieldsValues(Dynamicweb.eCommerce.Products.PropertyTypeCollection Types, Dictionary<string, string> propertyValueDictionary, Dynamicweb.Rendering.Template ParentTemplate) { //TODO: insert your code here } private void RenderGroupFieldTypes(Dynamicweb.eCommerce.Products.PropertyTypeCollection Types, Dictionary<string, string> propertyValueDictionary, Dynamicweb.Rendering.Template ParentTemplate) { //TODO: insert your code here } }
System.Object
System.Collections.ObjectModel.Collection<T>
Dynamicweb.eCommerce.Products.PropertyProductValueCollection
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2