private void ApplyReadAs()
        {
            Hashtable4  readAs = Container().ConfigImpl.ReadAs();
            IEnumerator i      = readAs.Iterator();

            while (i.MoveNext())
            {
                IEntry4 entry    = (IEntry4)i.Current;
                string  dbName   = (string)entry.Key();
                string  useName  = (string)entry.Value();
                byte[]  dbbytes  = GetNameBytes(dbName);
                byte[]  useBytes = GetNameBytes(useName);
                if (ClassByBytes().Get(useBytes) == null)
                {
                    ClassMetadata clazz = (ClassMetadata)ClassByBytes().Get(dbbytes);
                    if (clazz != null)
                    {
                        clazz.i_nameBytes = useBytes;
                        clazz.SetConfig(ConfigClass(dbName));
                        ClassByBytes().Remove(dbbytes);
                        ClassByBytes().Put(useBytes, clazz);
                    }
                }
            }
        }
        public virtual void TestToString()
        {
            Hashtable4 table = new Hashtable4();

            table.Put("foo", "bar");
            table.Put("bar", "baz");
            Assert.AreEqual(Iterators.Join(table.Iterator(), "{", "}", ", "), table.ToString(
                                ));
        }
        private int CountKeys(Hashtable4 table)
        {
            int         count = 0;
            IEnumerator i     = table.Iterator();

            while (i.MoveNext())
            {
                count++;
            }
            return(count);
        }
        private void AssertIterator(Hashtable4 table, object[] keys)
        {
            IEnumerator iter     = table.Iterator();
            Collection4 expected = new Collection4(keys);

            while (iter.MoveNext())
            {
                IEntry4 entry     = (IEntry4)iter.Current;
                bool    removedOK = expected.Remove(entry.Key());
                Assert.IsTrue(removedOK);
            }
            Assert.IsTrue(expected.IsEmpty(), expected.ToString());
        }
Exemplo n.º 5
0
        public void ApplyConfigurationItems(IInternalObjectContainer container)
        {
            Hashtable4 items = ConfigurationItems();

            if (items == null)
            {
                return;
            }
            IEnumerator i = items.Iterator();

            while (i.MoveNext())
            {
                IEntry4            entry = (IEntry4)i.Current;
                IConfigurationItem item  = (IConfigurationItem)entry.Value();
                item.Apply(container);
            }
        }