예제 #1
0
        public void GetListOfInheritedObjects()
        {
            using (Zetbox.API.IZetboxContext ctx = GetContext())
            {
                bool intFound    = false;
                bool stringFound = false;

                var list = ctx.GetQuery <Zetbox.App.Base.Property>().ToList();
                Assert.That(list.Count, Is.GreaterThan(0));

                foreach (Zetbox.App.Base.Property bp in list)
                {
                    if (bp is Zetbox.App.Base.IntProperty)
                    {
                        intFound = true;
                    }
                    if (bp is Zetbox.App.Base.StringProperty)
                    {
                        stringFound = true;
                    }
                }

                Assert.That(intFound, Is.True);
                Assert.That(stringFound, Is.True);
            }
        }
예제 #2
0
        private List <string> CreateMappings(Zetbox.API.IZetboxContext ctx)
        {
            this.RunTemplateWithExtension(ctx, "Mappings.CollectionEntriesHbm", "CollectionEntries", "hbm.xml");
            foreach (var oc in ctx.GetQuery <ObjectClass>().Where(i => i.BaseObjectClass == null))
            {
                this.RunTemplateWithExtension(ctx, "Mappings.ObjectClassHbm", oc.Name, "hbm.xml",
                                              Templates.Mappings.ObjectClassHbm.MakeArgs(ctx, oc, new NameValueCollection()
                {
                    { "extrasuffix", ExtraSuffix }
                }));
            }

            // Mapping files are picked up automatically by the ProjectFile
            // so we don't need to keep track of them.
            return(new List <string>());
        }