Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Current »

Sometimes it's convenient to have a property that limits the user to selecting from a fixed set of choices. For instance, in the SortedList.cst template, the Accessibility property controls the accessibility of the generated class:

To accomplish this, you need to take two steps. First, define an enumeration in a <script> block in your code:

<script runat="template">
Public Enum AccessibilityEnum
      [Public]
      [Protected]
      [Friend]
      [ProtectedFriend]
      [Private]
End Enum
</script>

Second, the Property directive should point to the enumeration:

<%@ Property Name="Accessibility" Type="AccessibilityEnum" Category="Options" Description="The accessibility of the class to be generated." %>

That's all there is to it!

  • No labels