Example #1
0
        /// <summary>
        /// Adds a sub category
        /// </summary>
        /// <param name="name">Name of the sub category</param>
        /// <exception cref="ArgumentException">If a category with the specified name already exists</exception>
        /// <exception cref="ArgumentNullException">If name is null</exception>
        public override LanguageNode AddNode(string name)
        {
            if (SubNodes.ContainsKey(name))
            {
                throw new ArgumentException("A category with specified name already exists.", "name");
            }

            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            lock (SubNodes)
            {
                SubNodes.Add(name, new MemLanguageNode(DefaultLCID, name));
                SubNodes[name].ParentNode = this;

                return(SubNodes[name]);
            }
        }