Esempio n. 1
0
        public void GenerateGridDefault(ref int line, TabSettings <TKey> settings)
        {
            if (settings.Gdb.LayoutIndexes != null)
            {
                AbstractProvider metaProvider = AbstractProvider.GetProvider(settings.Gdb.LayoutIndexes);

                if (metaProvider is GroupIndexProvider)
                {
                    AbstractProvider gridProvider = AbstractProvider.GetProvider(settings.Gdb.GridIndexes);
                    gridProvider.GroupAs = typeof(SpecifiedIndexProvider);
                    bool col = false;

                    foreach (IIndexProvider provider in metaProvider.Providers)
                    {
                        AbstractProvider gridLayout = gridProvider.Next <AbstractProvider>();
                        GTabsMaker.PrintGrid(ref line, (col = !col) ? 0 : 3, 1, 2, provider, gridLayout, settings.GeneralProperties, settings.Gdb.AttributeList);
                        if (col)
                        {
                            line--;
                        }
                    }
                }
                else
                {
                    GTabsMaker.Print(ref line, metaProvider, settings.GeneralProperties, settings.Gdb.AttributeList);
                }
            }
            else
            {
                GTabsMaker.Print(ref line, new SpecifiedRangeIndexProvider(new int[] { 0, settings.Gdb.AttributeList.Attributes.Count }), settings.GeneralProperties, settings.Gdb.AttributeList);
            }
        }
Esempio n. 2
0
        private void _generateGrid(ref int line, GenericDatabase database, TabControl control, DisplayableProperty <TKey, ReadableTuple <TKey> > generalProperties, BaseDb gdb)
        {
            if (gdb.LayoutIndexes != null)
            {
                AbstractProvider metaProvider = AbstractProvider.GetProvider(gdb.LayoutIndexes);

                if (metaProvider is GroupIndexProvider)
                {
                    AbstractProvider gridProvider = AbstractProvider.GetProvider(gdb.GridIndexes);
                    gridProvider.GroupAs = typeof(SpecifiedIndexProvider);
                    bool col = false;

                    foreach (IIndexProvider provider in metaProvider.Providers)
                    {
                        AbstractProvider gridLayout = gridProvider.Next <AbstractProvider>();
                        GTabsMaker.PrintGrid(ref line, (col = !col) ? 0 : 3, 1, 2, provider, gridLayout, generalProperties, gdb.AttributeList);
                        if (col)
                        {
                            line--;
                        }
                    }
                }
                else
                {
                    GTabsMaker.Print(ref line, metaProvider, generalProperties, gdb.AttributeList);
                }
            }
            else
            {
                GTabsMaker.Print(ref line, new SpecifiedRangeIndexProvider(new int[] { 0, gdb.AttributeList.Attributes.Count }), generalProperties, gdb.AttributeList);
            }
        }