Example #1
0
        public void BuildColumns(Zetbox.App.Base.ObjectClass cls, Mode mode, bool showMethods)
        {
            if (cls == null)
            {
                throw new ArgumentNullException("cls");
            }

            var props = cls.GetAllProperties()
                        .Where(p => ContainsSummaryTag(p.CategoryTags))
                        .ToList();

            if (props.Count == 0)
            {
                props = cls.GetAllProperties().Where(p =>
                {
                    var orp = p as ObjectReferenceProperty;
                    if (orp == null)
                    {
                        return(true);
                    }

                    switch (orp.RelationEnd.Parent.GetRelationType())
                    {
                    case RelationType.n_m:
                        return(false);    // don't display lists in grids

                    case RelationType.one_n:
                        return(orp.RelationEnd.Multiplicity.UpperBound() > 1);    // if we're "n", the navigator is a pointer, not a list

                    case RelationType.one_one:
                        return(true);    // can always display

                    default:
                        break;     // return false; // something went wrong
                    }
                    return(false); // workaround for https://bugzilla.novell.com/show_bug.cgi?id=660569
                })
                        .ToList();
            }

            var methods = cls.GetAllMethods()
                          .Where(m => m.IsDisplayable && ContainsSummaryTag(m.CategoryTags));

            BuildColumns(cls, props, showMethods ? methods.ToArray() : new Method[0], mode);
        }
Example #2
0
 public Template(Arebis.CodeGeneration.IGenerationHost _host, Zetbox.API.IZetboxContext ctx, Zetbox.App.Base.ObjectClass cls)
     : base(_host, ctx, cls)
 {
 }
Example #3
0
 public static void postSet_BaseObjectClass(Zetbox.App.Base.ObjectClass obj, PropertyPostSetterEventArgs <Zetbox.App.Base.ObjectClass> e)
 {
 }
Example #4
0
 public static void NotifyCreated(Zetbox.App.Base.ObjectClass obj)
 {
 }
Example #5
0
 public static void NotifyPreSave(Zetbox.App.Base.ObjectClass obj)
 {
 }