///////////////////////////////////////////////////////////////////////
        /// <summary>Creates a new entry</summary>
        ///////////////////////////////////////////////////////////////////////
        public GBaseEntry() : base()
        {
            attributes         = new GBaseAttributes(ExtensionElements);
            itemTypeDefinition = new ItemTypeDefinition(ExtensionElements);

            // now add appcontrol
            AppControl app = new AppControl();

            AppControl acf = FindExtensionFactory(app.XmlName, app.XmlNameSpace) as AppControl;

            if (acf == null)
            {
                // create a default appControl element
                acf = new AppControl();
                this.AddExtension(acf);
            }
            // add the publishing priority element factory
            acf.ExtensionFactories.Add(new PublishingPriority());
        }
        ///////////////////////////////////////////////////////////////////////
        /// <summary>Creates a new entry</summary>
        ///////////////////////////////////////////////////////////////////////
        public GBaseEntry() : base()
        {
            attributes = new GBaseAttributes(ExtensionElements);
            itemTypeDefinition = new ItemTypeDefinition(ExtensionElements);

            // now add appcontrol
            AppControl app = new AppControl();

            AppControl acf = FindExtensionFactory(app.XmlName, app.XmlNameSpace) as AppControl;
            if (acf == null)
            {
                // create a default appControl element
                acf = new AppControl();
                this.AddExtension(acf);
            }
            // add the publishing priority element factory
            acf.ExtensionFactories.Add(new PublishingPriority());

        }
        public void ItemTypeDefinitionTest()
        {
            AttributeId[] ids = { new AttributeId("x", GBaseAttributeType.Int) };

            ExtensionList extList = ExtensionList.NotVersionAware();
            //extList.Add("garbage");
            //extList.Add(12);

            ItemTypeDefinition defs = new ItemTypeDefinition(extList);
            Assert.IsNull(defs.ItemType);
            Assert.IsNotNull(defs.Attributes);
            Assert.AreEqual(0, defs.Attributes.Count);

            extList.Add(new MetadataItemType("hello"));
            Assert.AreEqual("hello", defs.ItemType);

            extList.Add(new ItemTypeAttributes(new List<AttributeId>(ids)));
            Assert.AreEqual(1, defs.Attributes.Count);
            Assert.AreEqual("x", defs.Attributes[0].Name);
        }
        public void ItemTypeDefinitionTest()
        {
            AttributeId[] ids = { new AttributeId("x", GBaseAttributeType.Int) };

            ArrayList extList = new ArrayList();
            extList.Add("garbage");
            extList.Add(12);

            ItemTypeDefinition defs = new ItemTypeDefinition(extList);
            Assert.IsNull(defs.ItemType);
            Assert.IsNotNull(defs.Attributes);
            Assert.AreEqual(0, defs.Attributes.Length);

            extList.Add(new MetadataItemType("hello"));
            Assert.AreEqual("hello", defs.ItemType);

            extList.Add(new ItemTypeAttributes(ids));
            Assert.AreEqual(1, defs.Attributes.Length);
            Assert.AreEqual("x", defs.Attributes[0].Name);
        }