Open.Core.PropertyListBuilder.Write C# (CSharp) Method

Write() public method

Writes to the given list.
public Write ( IHtmlList htmlList ) : void
htmlList IHtmlList The HTML list.
return void
        public void Write(IHtmlList htmlList)
        {
            // Setup initial conditions.
            if (Script.IsNullOrUndefined(instance)) return;

            // Create the property list.
            htmlList.Container.AddClass(LogCssClasses.PropertyList);

            // Insert the property values.
            foreach (DictionaryEntry entry in Dictionary.GetDictionary(instance))
            {
                string propName = isDictionary ? entry.Key : GetPropertyName(entry.Key);
                if (propName == null) continue;

                object value = isDictionary ?
                                                FormatPropertyValue(entry.Value, false) : 
                                                GetPropertyValue(instance, entry);
                string item = string.Format(
                    "<span class='{0}'>{1}:</span>&nbsp;{2}",
                    LogCssClasses.PropertyName,
                    propName,
                    value);
                htmlList.Add(item);
            }            
        }
        #endregion