I have created a new type that I want to contribute (and I have permission from my employer).
I could not readily find documentation on how to contribute, so here's the code:
//
// NAntContrib OptionSet
//
// Copyright (C) 2004 Payton Byrd ([EMAIL PROTECTED])
//
// Portions
// Copyright (C) 2004 Gert Driesen ([EMAIL PROTECTED])
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
using System;
using System.Collections;
using NAnt.Core;
using NAnt.Core.Attributes;
using NAnt.Core.Util;
using NAnt.Core.Types;
namespace NAnt.Contrib.Types {
/// <summary>
/// Optionsets are groups of options. These options may be defined
/// inside a task, or they may be named and defined outside a task
/// and used from a refid.
/// </summary>
[Serializable()]
[NAnt.Core.Attributes.ElementName("optionset")]
public class OptionSet : DataTypeBase {
private OptionCollection _options = new OptionCollection();
/// <summary>
/// Provides accesibility to the OptionCollection.
/// </summary>
public OptionCollection Options {
get { return _options; }
}
/// <summary>
/// Initializes a new instance of the <see cref="OptionSet" /> class.
/// </summary>
public OptionSet() {
}
/// <summary>
/// copy constructor
/// </summary>
/// <param name="fs"></param>
public OptionSet(OptionSet os) {
os.CopyTo((OptionSet)this);
}
/// <summary>
/// The items to include in the optionset.
/// </summary>
[BuildElementArray("option")]
public Option[] OptionElements {
set {
foreach (Option option in value) {
_options.Add(option);
}
}
}
#region Implementation of ICloneable
/// <summary>
/// Creates a shallow copy of the <see cref="OptionSet" />.
/// </summary>
/// <returns>
/// A shallow copy of the <see cref="OptionSet" />.
/// </returns>
public virtual object Clone() {
OptionSet clone = new OptionSet();
clone._options.AddRange(_options);
return clone;
}
#endregion Implementation of ICloneable
}
}
Trane eBusiness
QED Team
Phone: 931-905-5386
Fax: 931-648-5901
