Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Warning
Please take notice that this class has been marked as obsolete. Please use a generic collection instead.

The StringCollection provides a way for users to enter a list of strings. In your code, you can refer to these strings as members of an array. To use this class, you must include a reference to the CodeSmith.CustomProperties assembly in your template:

Code Block
languagehtml/xml
<%@ Assembly Name="CodeSmith.CustomProperties" %>

After you include the appropriate assembly reference, you can define a property in a script block that uses the StringCollection

Code Block
languagehtml/xml
<%@ Property Name="List" Type="CodeSmith.CustomProperties.StringCollection" Category="Custom" Description="This is the list." %>

When the user executes the template, the specified property will display a builder button on the property sheet:

IMAGE GOES HEREImage Added

Clicking the builder button will open an editor that allows the user to type strings on separate lines:

IMAGE GOES HEREImage Added

Info

You can also edit the members of the collection directly in the property grid as a comma-separated list.

In your code, you can iterate through the collection as an array:unmigrated-wiki-markup

The list is:

Code Block
languagehtml/xml
<% for (int i = 0; i < List.Count; i++)

...

\{ %>
<%= List

...

[i

...

] %>
<% \} %>