public StringIdSet(StringIdCollectionDefintion def, int index, string name, int id, int capacity) : this(def, index)
        {
            Id   = id;
            Name = name ?? kDefaultName;

            InitializeSets(capacity);
        }
        public void StreamFromXml(IO.XmlStream s)
        {
            foreach (System.Xml.XmlNode n in s.Cursor.ChildNodes)
            {
                if (n.Name == "definition")
                {
                    s.SaveCursor(n as System.Xml.XmlElement);
                    Definition = new StringIdCollectionDefintion();
                    Definition.StreamXml(s);
                    s.RestoreCursor();
                }
                else if (n.Name == "sets")
                {
                    s.SaveCursor(n as System.Xml.XmlElement);
                    StreamSetsFromXml(s);
                    s.RestoreCursor();
                }
            }

            Definition.CalculateInitialIdForAdding(this);
        }
        public StringIdStaticCollection(StringIdCollectionDefintion definition)
        {
            //Contract.Requires(definition != null);

            Definition = definition;
        }
 /// <summary>Only for <see cref="StringIdStaticCollection"/></summary>
 internal StringIdSet(StringIdCollectionDefintion def, int index)
 {
     Index      = index;
     Definition = def;
 }