Exemplo n.º 1
0
        /// <summary>
        /// Changes the object associated with the string at a specified index.
        /// </summary>
        /// <param name="Index"></param>
        /// <param name="Obj"></param>
        public void SetObject(int Index, Object Obj)
        {
            Check(Index);

            TStringsItem si = InnerList.GetValue(Index) as TStringsItem;

            si.FObject = Obj;
            InnerList.SetValue(si, Index);
        }
Exemplo n.º 2
0
        void Put(int Index, string S)
        {
            Check(Index);

            TStringsItem si = InnerList.GetValue(Index) as TStringsItem;

            si.FString = S;
            InnerList.SetValue(si, Index);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Adds a string to the list, and associates an object with the string.
        /// </summary>
        /// <param name="Value"></param>
        /// <param name="Obj"></param>
        /// <returns></returns>

        public int AddObject(string Value, Object Obj)
        {
            int Result;

            Result = Add(Value);
            TStringsItem si = InnerList.GetValue(Result) as TStringsItem;

            si.FObject = Obj;
            InnerList.SetValue(si, Result);

            return(Result);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Adds a string at the end of the list.
        /// </summary>
        /// <param name="st"></param>
        /// <returns>Returns the index of the new string.</returns>

        public int Add(string st)
        {
            TStringsItem StringItem = new TStringsItem();

            StringItem.FString = st;
            int Result = -1;

            if (_Count + 1 > InnerList.Length)
            {
                Array tmp = Array.CreateInstance(Type.GetType(typeof(TStringsItem).AssemblyQualifiedName), InnerList.Length + NEW_SIZE);

                InnerList.CopyTo(tmp, 0);
                InnerList = tmp;
            }

            InnerList.SetValue(new TStringsItem(st), _Count);
            Result = _Count;

            _Count += 1;

            return(Result);
        }