Dynamicweb.eCommerce.Products Namespace : PropertyFieldCollection Class |
'Declaration
<DefaultMemberAttribute("Item")> <SerializableAttribute()> Public Class PropertyFieldCollection Inherits System.Collections.ObjectModel.Collection(Of PropertyField)
[DefaultMemberAttribute("Item")] [SerializableAttribute()] public class PropertyFieldCollection : System.Collections.ObjectModel.Collection<PropertyField>
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.PropertyFieldCollection
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