Hi,

I've added a possible implementation to CVS that allows us to support global
collections. 

To summarize implementation : 

- modify the collection class to derive from a new DataTypeCollectionBase
- have it implement Ilist
- add an ElementName attribute (with the name of the global type)
- add a BuildElement attribute to the Add method

Classes that use the collection should have both a getter and a setter for
the collection to allow the referenced type to be set.

That last part is what I have a problem with: I'd really like to have an
implementation that avoids the need for having setters on collection based
properties. Anyone have any bright ideas on this or does anyone have time to
give this some thought ? How exactly has support for referencable types been
implemented in Ant ? Any lessons we can learn from them ?

As a example / proof of concept, I've transformed the <imports> child
element that is used in <vbc>, <script> and <asminfo> into a global type
called <namespaceimports>.

This allows the following build fragment to be used:

<project name="whatever" default="build">
        <namespaceimports id="test.imports">
                <import namespace="System" />
                <import namespace="System.Data" />
                <import namespace="System.Windows.Forms" />
        </namespaceimports>

        <target name="build">
                <vbc ...>
                        <imports refid="test.imports" />
                        ...
                </vbc>
        </target>
</project>

Any feedback on the implementation is greatly appreciated !

Gert



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to