Yes, decision tree won't help you much. You should not use well-known structures all the time, sometimes you need to use your own brain. :-)
This is not permutations at all, but I can get the idea. This is just the combination of all different options.
You should create an options space. The dimension of the space should be a number of control. Let's assume, perhaps with some simplification, that all options are represented by check boxes, groups of radio boxes, and list or combo boxistes. Each group of radio boxes, each individual list or combo box and each individual check box will represent a special dimensions. Count them all (a radio box group counts as one) to get the total dimension of the space. In each dimension, you have final number of points: two for each check box, and several points depending on the number of choice items in each of the other cases. Let's say, you have N-dimensional space.
OK, now represent it simply as an array of the rank N and appropriate number of points (options) in each direction
ArrayType [,,,,]
where number of commas is equal to
N−1
. Total number of option combinations will be a product of numbers of options in each dimensions.
Now, the question is: the array of what? What would be the type
ArrayType
? My answer is: it will be an
array of delegate instances. You can create several method with the same signature (depending on application, but one parameter should be a multi-dimensional point, that is, a position in your multi-dimensional array). You can create several methods; you will create delegate instances and put identical instances in some array elements, different instances in others, depending on how options work. The point (multi-dimensional index) will describe all options at once.
Please see my somewhat similar idea in my CodeProject article:
Dynamic Method Dispatcher[
^].
For another related construct, please see my design of a
finite-state machine in another article, pay attention for the referenced chapter (3.6 Cartesian Square):
Enumeration Types do not Enumerate! Working around .NET and Language Limitations[
^].
—SA