Hi All,

 

I am writing my own custom task and I would like to have a collection of strings as an element… something like the following:

 

<customtask>

    <filters>

        <pattern name=”pattern1” />

        <pattern name=”pattern2” />

        <pattern name=”pattern3” />

    </filters>

</customtask>

 

My code looks like this:

 

[BuildElementCollection("filters", "pattern")]

public StringCollection Patterns {

    get { return _patterns; }

}

 

This didn’t work.

 

I would like to be able to use the Patterns property in a foreach loop something like this:

 

public void ProcessPatterns() {

    foreach (string pattern in Patterns) {

        // do something with pattern

    }

}

 

Could someone help me to get the syntax correct? Thanks!

 

--Edwin

 

Reply via email to