NAnt.Core.Util.CommandLineArgument.CommandLineArgument C# (CSharp) Method

CommandLineArgument() public method

public CommandLineArgument ( NAnt.Core.Util.CommandLineArgumentAttribute attribute, PropertyInfo propertyInfo ) : System
attribute NAnt.Core.Util.CommandLineArgumentAttribute
propertyInfo System.Reflection.PropertyInfo
return System
        public CommandLineArgument(CommandLineArgumentAttribute attribute, PropertyInfo propertyInfo)
        {
            _attribute = attribute;
            _propertyInfo = propertyInfo;
            _seenValue = false;

            _elementType = GetElementType(propertyInfo);
            _argumentType = GetArgumentType(attribute, propertyInfo);

            if (IsCollection || IsArray) {
                _collectionValues = new ArrayList();
            } else if (IsNameValueCollection) {
                _valuePairs = new NameValueCollection();
            }

            Debug.Assert(LongName != null && LongName.Length > 0);
            Debug.Assert((!IsCollection && !IsArray && !IsNameValueCollection) || AllowMultiple, "Collection and array arguments must have allow multiple");
            Debug.Assert(!Unique || (IsCollection || IsArray || IsNameValueCollection), "Unique only applicable to collection arguments");
        }