| 11 | | As all Wiki pages, this page is editable, this means that you can |
| 12 | | modify the contents of this page simply by using your |
| 13 | | web-browser. Simply click on the "Edit this page" link at the bottom |
| 14 | | of the page. WikiFormatting will give you a detailed description of |
| 15 | | available Wiki formatting commands. |
| | 7 | 1. IContinuation for specifying page parameter types |
| | 8 | 1. Unsafe<T> for specifying unsafe/insecure page parameters |
| | 9 | 1. Continuation.ToUrl overloads for generating URLs from continuations + arguments |
| | 10 | 1. Continuation.TryParseX for parsing page parameters |
| 22 | | You can use [wiki:TracAdmin trac-admin] to configure |
| 23 | | [http://trac.edgewall.org/ Trac] to better fit your project, especially in |
| 24 | | regard to ''components'', ''versions'' and ''milestones''. |
| 25 | | |
| 26 | | |
| 27 | | TracGuide is a good place to start. |
| 28 | | |
| 29 | | Enjoy! [[BR]] |
| 30 | | ''The Trac Team'' |
| 31 | | |
| 32 | | == Starting Points == |
| 33 | | |
| 34 | | * TracGuide -- Built-in Documentation |
| 35 | | * [http://trac.edgewall.org/ The Trac project] -- Trac Open Source Project |
| 36 | | * [http://trac.edgewall.org/wiki/TracFaq Trac FAQ] -- Frequently Asked Questions |
| 37 | | * TracSupport -- Trac Support |
| 38 | | |
| 39 | | For a complete list of local wiki pages, see TitleIndex. |
| | 14 | A typed page parameter list is specified via an IContinuation<...> declaration, like so: |
| | 15 | {{{ |
| | 16 | public class SomePage : System.Web.Page, IContinuation<int, string> |
| | 17 | { |
| | 18 | ... |
| | 19 | } |
| | 20 | }}} |
| | 21 | This declares a page that accepts a protected Int32 as the first argument, and a protected string as the second argument. By default, all types specified in an IContinuation<...> declaration will be protected, which means they cannot be changed by clients. If you wish to declare that a certain page parameter is unprotected, then you need only wrap it with Unsafe<T>. For instance, suppose the integer argument from the above example should be unprotected: |
| | 22 | {{{ |
| | 23 | public class SomePage : System.Web.Page, IContinuation<Unsafe<int>, string> |
| | 24 | { |
| | 25 | ... |
| | 26 | } |
| | 27 | }}} |
| | 28 | Any type can appear as an argument to IContinuation<...>, not just primitive values. In fact, it's good practice in Clavis not to use primitive types since parameter names are generated from the class name by default: |
| | 29 | {{{ |
| | 30 | public class SomePage : System.Web.Page, IContinuation<Unsafe<Project>, Customer> |
| | 31 | { |
| | 32 | ... |
| | 33 | } |
| | 34 | }}} |
| | 35 | Clavis can also handle lists of values by specifying IEnumerable<T> as a parameter type: |
| | 36 | {{{ |
| | 37 | public class SomePage : System.Web.Page, IContinuation<IEnumerable<Project>, Customer> |
| | 38 | { |
| | 39 | ... |
| | 40 | } |
| | 41 | }}} |
| | 42 | IEnumerable<T> and Unsafe<T> can also be nested, so you can have an unsafe list of objects as a parameter: |
| | 43 | {{{ |
| | 44 | public class SomePage : System.Web.Page, IContinuation<Unsafe<IEnumerable<Project>>, Customer> |
| | 45 | { |
| | 46 | ... |
| | 47 | } |
| | 48 | }}} |