/// <summary>
 /// Copy Constructor
 /// </summary>
 /// <param name="propertiesDictionary">properties to copy</param>
 /// <remarks>
 /// <para>
 /// Initializes a new instance of the <see cref="ReadOnlyPropertiesDictionary" /> class.
 /// </para>
 /// </remarks>
 public ReadOnlyPropertiesDictionary(ReadOnlyPropertiesDictionary propertiesDictionary)
 {
     foreach (DictionaryEntry entry in propertiesDictionary)
     {
         InnerHashtable.Add(entry.Key, entry.Value);
     }
 }
示例#2
0
 public void Add(ManagedObjectName objectName, Entry instance)
 {
     lock (this)
     {
         InnerHashtable.Add(objectName, instance);
     }
 }
示例#3
0
 public fk_columns(DataRow row)
 {
     foreach (string field in fields.Split(','))
     {
         InnerHashtable.Add(field, row[field]);
     }
 }
示例#4
0
 /// <summary>
 /// See <see cref="IDictionary.Add"/>
 /// </summary>
 /// <param name="key">the key</param>
 /// <param name="value">the value to store for the key</param>
 /// <remarks>
 /// <para>
 /// Store a value for the specified <see cref="String"/> <paramref name="key"/>.
 /// </para>
 /// </remarks>
 /// <exception cref="ArgumentException">Thrown if the <paramref name="key"/> is not a string</exception>
 void IDictionary.Add(object key, object value)
 {
     if (!(key is string))
     {
         throw new ArgumentException("key must be a string", "key");
     }
     InnerHashtable.Add(key, value);
 }
示例#5
0
 // Instance Methods
 public void Add(string key, Symbol value)
 {
     if (InnerHashtable.Contains(key))
     {
         Debug.Fail(Owner.FullName + " already holds " + key);
     }
     InnerHashtable.Add(key, value);
 }
示例#6
0
        public void Add(string name, object value)
        {
            if (string.IsNullOrEmpty(name))
            {
                return;
            }

            InnerHashtable.Add(name, value);
        }
 /// <summary>
 /// Adds the data the dictionary from reader
 /// </summary>
 public void AddData(SqlDataReader reader)
 {
     while (reader.Read())
     {
         string key = reader.GetString(1);
         if (Contains(key))
         {
             InnerHashtable.Remove(key);
         }
         InnerHashtable.Add(key, new App(reader));
     }
     reader.Close();
 }
 void IDictionary.Add(object key, object value)
 {
     OnValidate(key, value);
     OnInsert(key, value);
     InnerHashtable.Add(key, value);
     try {
         OnInsertComplete(key, value);
     }
     catch {
         InnerHashtable.Remove(key);
         throw;
     }
 }
示例#9
0
        /// <summary>
        /// Construct a JsonObject from a IDictionary
        /// </summary>

        public JsonObject(IDictionary members)
        {
            foreach (DictionaryEntry entry in DictionaryHelper.GetEntries(members))
            {
                if (entry.Key == null)
                {
                    throw new InvalidMemberException();
                }

                InnerHashtable.Add(entry.Key.ToString(), entry.Value);
            }

            _nameIndexList = new ArrayList(members.Keys);
        }
示例#10
0
        public IPAddresses(string filePath)
        {
            string line;

            string[]     words;
            StreamReader streamReader = File.OpenText(filePath);

            while (streamReader.Peek() != -1)
            {
                line  = streamReader.ReadLine();
                words = line.Split(',');
                InnerHashtable.Add(words[0], words[1]);
            }
            streamReader.Close();
        }
示例#11
0
        /// <summary>
        /// Construct a JObject from a IDictionary
        /// </summary>

        public JsonObject(IDictionary members)
        {
            // FIXME: Use IDictionaryEnumerator.Entry instead and enumerate manually (faster and more robust).
            // See comment in DictionaryExporter for details.

            foreach (DictionaryEntry entry in members)
            {
                if (entry.Key == null)
                {
                    throw new InvalidMemberException();
                }

                InnerHashtable.Add(entry.Key.ToString(), entry.Value);
            }

            _nameIndexList = new ArrayList(members.Keys);
        }
        void IDictionary.Remove(object key)
        {
            if (InnerHashtable.Contains(key))
            {
                Object temp = InnerHashtable[key];
                OnValidate(key, temp);
                OnRemove(key, temp);

                InnerHashtable.Remove(key);
                try {
                    OnRemoveComplete(key, temp);
                }
                catch {
                    InnerHashtable.Add(key, temp);
                    throw;
                }
            }
        }
示例#13
0
 public void Add(string url, Exception value)
 {
     InnerHashtable.Add(url, value);
 }
        /// <summary>
        /// Default constructor
        /// </summary>
        public AppDictionary()
        {
            App a = new App(true);

            InnerHashtable.Add(a.ApplicationName, a);
        }
示例#15
0
 protected void BaseAdd(string name, object value)
 {
     InnerHashtable.Add(name, value);
 }
示例#16
0
 public void Add(string name, ILQHsm hsm)
 {
     InnerHashtable.Add(name, hsm);
 }
示例#17
0
 public void Add(string name, string ip)
 {
     InnerHashtable.Add(name, ip);
 }