Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="name"></param>
        /// <param name="value"></param>
        /// <param name="description"></param>
        public void Add(string name, object value, string description)
        {
            Assert.IsValidOperation(!ContainsKey(name));

            var attribute = new ConfigurationAttribute(name, value, description);

            _collection.Add(attribute);
        }
    /// <summary>
    ///
    /// </summary>
    /// <param name="value"></param>
    /// <returns></returns>
    public override int Add(object value)
    {
        ArgumentNullException.ThrowIfNull(value);
        Assert.IsTrue(value is TextDataParameter);

        var parameter = (TextDataParameter)value;

        _collection.Add(parameter);
        return(_collection.Count - 1);
    }
        /// <summary>
        ///
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public override int Add(object value)
        {
            Assert.IsNotNull(value);
            FoundationContract.Requires <ArgumentException>(value is TextDataParameter);

            var parameter = (TextDataParameter)value;

            _collection.Add(parameter);
            return(_collection.Count - 1);
        }
Beispiel #4
0
    public CommandLine(string commandLine)
    {
        ArgumentNullException.ThrowIfNull(commandLine);

        _arguments = new IndexableCollection <CommandLineArgument>(ListIndex);
        var dictionary = new Dictionary <string, ICollection <CommandLineArgument> >(StringComparer.InvariantCultureIgnoreCase);

        NameIndex = new NonUniqueIndex <string, CommandLineArgument>(
            "nameIndex",
            argument => GetKeyResponse.Create(argument.Name != null, argument.Name),
            dictionary,
            () => new List <CommandLineArgument>());
        _arguments.Indexes.Add(NameIndex);
        var stringReader = new StringReader(commandLine);
        var arguments    = Parse(stringReader);

        _arguments.Add(arguments);
    }
 public void Add(ConfigurationNode item)
 {
     Assert.IsTrue(item != null);
     _collection.Add(item);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="item"></param>
 public void Add(XmlSpreadsheetAttribute item)
 {
     _items.Add(item);
 }
Beispiel #7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="item"></param>
 public void Add(TextDataColumn item)
 {
     _collection.Add(item);
 }
Beispiel #8
0
    private static void Add(string name, Type type)
    {
        var item = new TypeCollectionItem(name, type);

        Collection.Add(item);
    }