Beispiel #1
0
 public void Generate(IResourceGenerator generator, IZetboxServerContext ctx, IEnumerable<Zetbox.App.Base.Module> modules)
 {
     using (var writer = generator.AddFile("ZetboxBase\\Modules")) // See ZetboxAssetKeys.Modules
     {
         foreach (var m in modules.OrderBy(m => m.Name))
         {
             writer.AddResource(ZetboxAssetKeys.ConstructNameKey(m), m.Name);
             writer.AddResource(ZetboxAssetKeys.ConstructDescriptionKey(m), m.Description);
         }
     }
 }
Beispiel #2
0
        public void Generate(IResourceGenerator generator, IZetboxServerContext ctx, IEnumerable<Zetbox.App.Base.Module> modules)
        {
            var moduleNames = modules.Select(m => m.Name).ToArray();

            using (var writer = generator.AddFile("GUI\\Applications")) // See ZetboxAssetKeys.Applications
            {
                foreach (var app in ctx.GetQuery<Application>()
                                        .ToList()
                                        .Where(a => moduleNames.Contains(a.Module.Name))
                                        .OrderBy(a => a.Name))
                {
                    writer.AddResource(ZetboxAssetKeys.ConstructNameKey(app), app.Name);
                    writer.AddResource(ZetboxAssetKeys.ConstructDescriptionKey(app), app.Description);
                }
            }
        }
Beispiel #3
0
        public void Generate(IResourceGenerator generator, IZetboxServerContext ctx, IEnumerable<Zetbox.App.Base.Module> modules)
        {
            var moduleNames = modules.Select(m => m.Name).ToArray();

            using (var writer = generator.AddFile("GUI\\NavigationEntries")) // See ZetboxAssetKeys.NavigationEntries
            {
                foreach (var nav in ctx.GetQuery<NavigationEntry>()
                                        .ToList()
                                        .Where(e => moduleNames.Contains(e.Module.Name))
                                        .OrderBy(e => e.Title))
                {
                    writer.AddResource(ZetboxAssetKeys.ConstructTitleKey(nav), nav.Title);
                    writer.AddResource(ZetboxAssetKeys.ConstructColorKey(nav), nav.Color);
                }
            }
        }
Beispiel #4
0
        public void Generate(IResourceGenerator generator, IZetboxServerContext ctx, IEnumerable<Zetbox.App.Base.Module> modules)
        {
            var moduleNames = modules.Select(m => m.Name).ToArray();

            var tags = GetTags(ctx, moduleNames);
            var exceptTags = moduleNames.Contains("ZetboxBase")
                    ? new List<string>()
                    : GetTags(ctx, "ZetboxBase", "GUI");

            using (var writer = generator.AddFile("ZetboxBase\\CategoryTags"))
            {
                foreach (var tag in tags.Except(exceptTags).OrderBy(i => i))
                {
                    if(!string.IsNullOrWhiteSpace(tag))
                        writer.AddResource(tag, tag);
                }
            }
        }
Beispiel #5
0
        public void Generate(IResourceGenerator generator, IZetboxServerContext ctx, IEnumerable<Zetbox.App.Base.Module> modules)
        {
            var moduleNames = modules.Select(m => m.Name).ToArray();

            using (var writer = generator.AddFile("ZetboxBase\\DataTypes")) // See ZetboxAssetKeys.DataTypes
            {
                foreach (var dt in ctx.GetQuery<DataType>()
                                        .ToList()
                                        .Where(dt => moduleNames.Contains(dt.Module.Name))
                                        .OrderBy(dt => dt.Name))
                {
                    writer.AddResource(ZetboxAssetKeys.ConstructNameKey(dt), dt.Name);
                    writer.AddResource(ZetboxAssetKeys.ConstructDescriptionKey(dt), dt.Description);
                }
            }

            foreach (var grp in ctx.GetQuery<Property>()
                                        .ToList()
                                        .Where(p => moduleNames.Contains(p.Module.Name))
                                        .GroupBy(p => p.ObjectClass)
                                        .OrderBy(p => p.Key.Module.Namespace)
                                        .ThenBy(p => p.Key.Name))
            {
                var dtName = grp.Key.Module.Namespace + "." + grp.Key.Name;
                using (var writer = generator.AddFile("ZetboxBase\\Properties\\" + dtName)) // See ZetboxAssetKeys.ConstructBaseName
                {
                    foreach (var prop in grp.OrderBy(p => p.Name))
                    {
                        writer.AddResource(ZetboxAssetKeys.ConstructLabelKey(prop), string.IsNullOrWhiteSpace(prop.Label) ? prop.Name : prop.Label);
                        writer.AddResource(ZetboxAssetKeys.ConstructDescriptionKey(prop), prop.Description);
                    }
                }
            }

            foreach (var grp in ctx.GetQuery<Method>()
                                        .ToList()
                                        .Where(m => moduleNames.Contains(m.Module.Name))
                                        .GroupBy(m => m.ObjectClass)
                                        .OrderBy(m => m.Key.Module.Namespace)
                                        .ThenBy(m => m.Key.Name))
            {
                var dtName = grp.Key.Module.Namespace + "." + grp.Key.Name;
                using (var writer = generator.AddFile("ZetboxBase\\Methods\\" + dtName)) // See ZetboxAssetKeys.ConstructBaseName
                {
                    foreach (var meth in grp.OrderBy(p => p.Name))
                    {
                        writer.AddResource(ZetboxAssetKeys.ConstructLabelKey(meth), string.IsNullOrWhiteSpace(meth.Label) ? meth.Name : meth.Label);
                        writer.AddResource(ZetboxAssetKeys.ConstructDescriptionKey(meth), meth.Description);

                        foreach (var param in meth.Parameter)
                        {
                            writer.AddResource(ZetboxAssetKeys.ConstructLabelKey(param), string.IsNullOrWhiteSpace(param.Label) ? param.Name : param.Label);
                            writer.AddResource(ZetboxAssetKeys.ConstructDescriptionKey(param), param.Description);
                        }
                    }
                }
            }

            foreach (var enumeration in ctx.GetQuery<Enumeration>()
                                            .ToList()
                                            .Where(dt => moduleNames.Contains(dt.Module.Name))
                                            .OrderBy(dt => dt.Name))
            {
                using (var writer = generator.AddFile("ZetboxBase\\Enumerations\\" + enumeration.Module.Namespace + "." + enumeration.Name)) // See ZetboxAssetKeys.ConstructBaseName
                {
                    foreach (var entry in enumeration.EnumerationEntries)
                    {
                        writer.AddResource(ZetboxAssetKeys.ConstructLabelKey(entry), string.IsNullOrWhiteSpace(entry.Label) ? entry.Name : entry.Label);
                        writer.AddResource(ZetboxAssetKeys.ConstructDescriptionKey(entry), entry.Description);
                    }
                }
            }
        }