Dynamicweb.eCommerce.Products Namespace : PropertyGroupCollection Class |
'Declaration
<DefaultMemberAttribute("Item")> <SerializableAttribute()> Public Class PropertyGroupCollection Inherits System.Collections.ObjectModel.Collection(Of PropertyGroup)
[DefaultMemberAttribute("Item")] [SerializableAttribute()] public class PropertyGroupCollection : System.Collections.ObjectModel.Collection<PropertyGroup>
class MyPage : System.Web.UI.Page { public void RenderGroupFieldGroups(Dynamicweb.eCommerce.Products.PropertyGroupCollection propertyGroups, Dictionary<string, string> fieldValueDictionary, Dynamicweb.Rendering.Template ParentTemplate) { if (!ParentTemplate.LoopExists("Groups")) { return; } Dynamicweb.Rendering.Template PropertyGroupTemplate = ParentTemplate.GetLoop("Groups"); foreach (PropertyGroup @group in propertyGroups) { PropertyGroupTemplate.SetTag("Ecom:Product:GroupField.Group.ID", @group.ID); PropertyGroupTemplate.SetTag("Ecom:Product:GroupField.Group.Name", @group.Name); RenderGroupFieldFields(@group.PropertyFields, fieldValueDictionary, PropertyGroupTemplate); PropertyGroupTemplate.CommitLoop(); } } public void RenderGroupFieldFields(Dynamicweb.eCommerce.Products.PropertyFieldCollection PropertyFields, Dictionary<string, string> fieldValueDictionary, Dynamicweb.Rendering.Template ParentTemplate) { if (!ParentTemplate.LoopExists("Fields")) { return; } Dynamicweb.Rendering.Template propertyFieldTemplate = ParentTemplate.GetLoop("Fields"); foreach (PropertyField field in PropertyFields) { propertyFieldTemplate.SetTag("Ecom:Product:GroupField.Field.ID", field.ID); propertyFieldTemplate.SetTag("Ecom:Product:GroupField.Field.Name", field.Label); if (field.InputType == Base.ChkInteger(PropertyField.InputTypeEnum.Dato).ToString() || field.InputType == Base.ChkInteger(PropertyField.InputTypeEnum.Datotid).ToString()) { propertyFieldTemplate.SetTag("Ecom:Product:GroupField.Field.Value", DateTime.FromBinary(Base.ChkLong(fieldValueDictionary[field.ID])), Base.GetCulture(true)); } else { propertyFieldTemplate.SetTag("Ecom:Product:GroupField.Field.Value", fieldValueDictionary[field.ID]); } propertyFieldTemplate.CommitLoop(); } } }
System.Object
System.Collections.ObjectModel.Collection<T>
Dynamicweb.eCommerce.Products.PropertyGroupCollection
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